Plotting and saving the picture with pcolor
Show older comments
Hello!
I have 180 data variables, which I would like to plot with pcolor and look at for 5 seconds and then it would be saved as .png, but I can't even get the first part to work. Here is my code:
list=who;
pause on
for i=1:180
pcolor(list(i));shading flat;colorbar
pause 5
end
As I understand, the variable list has strings with apostrophes, so list(i) will be 'variablename'. If anyone could help with the code, it would be very appreciated.
3 Comments
Image Analyst
on 8 Mar 2013
Edited: Image Analyst
on 8 Mar 2013
If "list" is a variable containing strings with apostrophes in them (like perhaps a list of filenames or something), then why do you want to display that with pcolor(), which is intended for numerical data? Is list a cell array, or a character array, or a numerical array? What does it look like if you do
list
whos list
on the command line? Even is list is a numerical array with one number per index, then why are you using pcolor, where you lose the last column and last row, rather than image()?
inga
on 10 Mar 2013
Image Analyst
on 10 Mar 2013
I'd need more proof than that. Why do you want to lose the last row and column? Why can't image() or imshow() work in your situation, like they do for everyone else's 750x660 numerical array?
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 8 Mar 2013
Edited: Azzi Abdelmalek
on 8 Mar 2013
Example
list={magic(4),magic(5)}
for i=1:numel(list)
pcolor(list{i}) ;
shading flat;
colorbar
pause(5)
end
Categories
Find more on Orange in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!