For loop to extract info from a structure doesn't work?
Posted
by ZaZu
on Stack Overflow
See other posts from Stack Overflow
or by ZaZu
Published on 2010-05-13T20:14:58Z
Indexed on
2010/05/13
20:24 UTC
Read the original article
Hit count: 190
I have a structure in matlab that has a value of <1x1 struct>.
, its name is figurelist
.
Inside that structure, there is a field called images
. Inside images, I have 25 images that have the name img1, img2, img3, ...... , img25.
Now I made a for loop to extract those images, I basically did:
For K=1:25
image(figurelist.images.imgK)
PAUSE(0.25)
End
This unfortunately doesnt work. I get an error saying :
??? Reference to non-existent field 'imgK'.
Is it possible to extract such info using a loop from a structure? Or am I doing something wrong? Thanks.
© Stack Overflow or respective owner