plot 2D gride
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to plot a gride of pressure distribution in x and y direction
x=1:15;
y=1:15;
Pressure=Psave; (%matrix size (1125,1))
댓글 수: 2
Akira Agata
2022년 4월 5일
Question for clarification:
Why the matrix size of the variable Pressure becomes 1125, instead of 225 (=15 x 15) ?
답변 (1개)
Voss
2022년 4월 6일
x = 1:15;
y = 1:15;
% some 225x1 Pressure values:
Pressure = reshape(5000-abs(2*x-y.'),[],1);
size(Pressure)
% reshape Pressure to numel(y)-by-numel(x), 15x15.
% your reshape might have to be different, depending on how the order of
% the elements in Pressure relates to x and y
surface(x,y,reshape(Pressure,numel(y),[]));
cb = colorbar();
xlabel('x')
ylabel('y')
ylabel(cb,'Pressure')
title('Pressure')
axis tight
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!