Selecting Images from the drop-down menu

Hi, I have this drop-down menu, and I would like to link the following list with images that I have saved.
Once the image is selected, I would like it to be displayed on the image holders.
Any help would be appreciated.

 採用された回答

yanqi liu
yanqi liu 2021 年 12 月 23 日

0 投票

% Value changed function: DropDown
function DropDownValueChanged(app, event)
value = lower(app.DropDown.Value);
if strfind(value, 'bird')
app.Original_image.ImageSource = imread('bird.jpeg');
end
if strfind(value, 'phone')
app.Original_image.ImageSource = imread('Phone.jpeg');
end
if strfind(value, 'camera')
app.Original_image.ImageSource = imread('Camera.jpeg');
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

製品

リリース

R2021b

質問済み:

2021 年 12 月 19 日

回答済み:

2021 年 12 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by