I have a loop that plots on figure for each different value of the counter, and each frame is stored in a variable M: for k:..... M(k)=getframe(gcf) end The problem is that M is a structure now and i cant use it with the videofig function from file exchange:
What can I do ?

2 Kommentare

Adam
Adam am 4 Okt. 2018
So is your question how to use imshow with a structure or how to use the linked file exchange functionality with a structure? They don't seem to be related.
Hi adam, Well if there is a way to use imshow with a structure it will help my problem with the function from the file exchange.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Stephen23
Stephen23 am 4 Okt. 2018

0 Stimmen

S = getframe(...)
imshow(S.cdata) % for TrueColor image (RGB).
imshow(S.cdata, S.colormap) % for indexed image.

3 Kommentare

Hi stephen, I tried your method and this is what matlab showed me :
Error Too many input arguments were passed to imageDisplayParsePVPairs.
the S is in a loop so at then end of the loop I have a structure of 600 elements(1x600 frames) and I'm trying to use them all, do you know how ? and thank you for your help
Stephen23
Stephen23 am 4 Okt. 2018
Bearbeitet: Stephen23 am 4 Okt. 2018
@Mohamad Hussein khalife: what I showed you will work for a scalar structure, i.e. the output of one getframe call, just like my answers shows. If you have a non-scalar structure, then imshow can only be called for any one element of that structure, e.g. to show them one at a time:
for k = 1:size(S)
imshow(S(k).cdata)
... whatever processing
end
After reading the help from the FEX submission videofig, you could probably just define an anonymous function like this, where S is your non-scalar structure:
videofig(numel(S), @(n) imshow(S(n).cdata))
You should also read this, to understand the comma-separated list that you were probably generating without realizing it:
yes it worked thanks a lot

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Display Image finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by