Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Error when using a cell as a property in app designer

1 Ansicht (letzte 30 Tage)
Kevin P Meyer
Kevin P Meyer am 9 Okt. 2021
Geschlossen: Kevin P Meyer am 9 Okt. 2021
Hello, I am using app designer and I am trying to save 2d image matrices into a cell. I am able to do this, and verified it in just regular matlab script. Since I want this data to be shared across the app, I am making the cell into a shared property so that other apps can do this. However, when I pull the data from the cell for some image, I get an error that brace indexing is not supported. I am not sure why, since I was able to do this earlier. I have attached some snippets of the code, does anyone know what I may be doing wrong? I want app.TOOLdata to be the cell in which I can find each image file, I will be using multiple image files with different sizes so I cannot concatenate them, so i think using a cell is required.
I = imread(filename);
if ndims(I) == 2 %#ok<ISMAT>
else
I = rgb2gray(I); %sets to grayscale if not already
end
if isa(I, 'double')
else
I = im2double(I); %sets to double if not already
end
app.TOOLdata{1} = I;
%%%another line where I get the error%%%
IM = app.TOOLdata{app.FrameEditField.Value}; %displays error (brace indexing not supported), in this case the frame is 1.

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by