Plotting and saving the picture with pcolor
Ältere Kommentare anzeigen
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 Kommentare
Image Analyst
am 8 Mär. 2013
Bearbeitet: Image Analyst
am 8 Mär. 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
am 10 Mär. 2013
Image Analyst
am 10 Mär. 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?
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 8 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 8 Mär. 2013
Example
list={magic(4),magic(5)}
for i=1:numel(list)
pcolor(list{i}) ;
shading flat;
colorbar
pause(5)
end
Kategorien
Mehr zu Orange 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!