Deleting an image in an image array doesn't appear to be working

1 visualización (últimos 30 días)
Jason
Jason el 30 de Mzo. de 2021
Comentada: Jason el 25 de Abr. de 2021
Hello, I have an image array consisting of 7 images. Im using an imspinner to delete an image at the required index given by the spinner.
currentImgIdx=app.ImSpinner.Value %In my example i want to delete image #6
disp('before')
size(app.imgArray)
app.imgArray{currentImgIdx}=[]; %I though this should delete the image at positon 6.
disp('after')
size(app.imgArray)
However, there appears to be no change in the size of imgArray and i can't figure out why
currentImgIdx =
6.00
before
ans =
1.00 7.00
after
ans =
1.00 7.00

Respuesta aceptada

Jan
Jan el 24 de Abr. de 2021
Editada: Jan el 24 de Abr. de 2021
What is an "ImSpinner"? I do not find it in the documentation.
What is an "image array"? I guess, it is a cell array. Then:
app.imgArray(currentImgIdx) = [];
with round parentheses. Remember that C{k}=[] does not remove the k'th cell element, but sets its contents to the empty matrix. C(k)=[] does remove the element.

Más respuestas (1)

Jason
Jason el 24 de Abr. de 2021
Anyone?

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by