How do I plot colored temperature distribution on a rectangular plate?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shubham Maurya
am 7 Apr. 2015
Kommentiert: Shubham Maurya
am 7 Apr. 2015
I have the data for temperature at every point and I want continuous colored plot corresponding to each temperature. Say, red for 100 degC and blue for 0 degC.
0 Kommentare
Akzeptierte Antwort
buzz
am 7 Apr. 2015
Let's suppose "plate" is the temperature distribution.
[M,N] = size(plate);
%Pay attention:
% M --> raws N --> coloumns
%BUT for meshgrid you must introduce (x,y) coordinates, so:
% M --> y N--> x
[x,y] = meshgrid(1:N,1:M);
surf(x,y,plate);
If plate would exceed [0-100] bounds, you could use a support variable:
plate_2 = plate;
plate_2(plate_2>100) = 100;
plate_2(plate_2<0) = 0;
surf(x,y,plate_2);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!