フィルターのクリア

Displaying images from cell arrays in app designer

3 ビュー (過去 30 日間)
Pranaya Kansakar
Pranaya Kansakar 2020 年 5 月 22 日
回答済み: Cris LaPierre 2020 年 12 月 20 日
I have a cell array whose cells contains images and I am trying to individually display the images in app designer.
I have tried the following code in app designer:
cellarray = uigetfile('*.*;');
Z = {cellarray,1};
c = imread(Z);
imshow(c,'Parent',app.UIAxes)
Here, I save a cell array as a .mat file which I try to open in an app.
However, it says that brace indexing is not supported.
I'm confused as the indexing in line 2 of the code above would work in the baseline MATLAB workspace but it doesn't seem to work in app designer?
Thanks for your help.

回答 (1 件)

Cris LaPierre
Cris LaPierre 2020 年 12 月 20 日
It looks like you are indexing your cell array incorrectly. See this page: Access Data in Cell Array.
Try something like this (untested)
cellarray = uigetfile('*.*');
Z = cellarray{1};
c = imread(Z);
imshow(c,'Parent',app.UIAxes)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by