How do I plot colored temperature distribution on a rectangular plate?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
채택된 답변
buzz
2015년 4월 7일
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);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Formatting and Annotation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!