gridmesh does not work for my case, why?

having u and v arrays of different sizes (54x1 and 61x1), I attempted to run the following;
function F = fcn(u,v)
[U,V]=meshgrid(u,v);
F= 1/((U.^(-0.66667))+(V.^(-0.6667)));
G=F.^(3/2);
surf(U,V,G)
3rd row did not work and says the following; "matrix dimensions must agree" ?!
what did I make wrong?

Antworten (1)

Dyuman Joshi
Dyuman Joshi am 3 Jun. 2023
You need to use element-wise division as well in defining F
u = rand(54,1);
v = rand(61,1);
[U,V]=meshgrid(u,v);
% v
F= 1./((U.^(-0.66667))+(V.^(-0.6667)));
G=F.^(3/2);
surf(U,V,G)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 3 Jun. 2023

Beantwortet:

am 3 Jun. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by