I got a matrix dimensions error while plotting a pressure field

조회 수: 1 (최근 30일)
Randy Chen
Randy Chen 2020년 10월 20일
답변: Walter Roberson 2020년 10월 20일
I got this error while trying to plot a pressure field. I have pressure P in terms of x and y:
[X1,Y1] = meshgrid(0:0.01:3,0:0.01:-0.005);
p = 101325-1/2*1.225*(900+(90/pi)*(X1/(X1^2+Y1^2))+9/(4*pi^2*(X1^2+Y1^2)));
Error using /
Matrix dimensions must agree.
I tried adding a dot before / but it still gives me the same error
I need to have p in terms of X1,Y1 and plot it using contour

채택된 답변

Walter Roberson
Walter Roberson 2020년 10월 20일
p = 101325-1/2*1.225*(900+(90/pi)*(X1./(X1.^2+Y1.^2))+9./(4*pi^2*(X1.^2+Y1.^2)));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by