I got a matrix dimensions error while plotting a pressure field

1 vue (au cours des 30 derniers jours)
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

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by