gridmesh does not work for my case, why?

3 visualizaciones (últimos 30 días)
omer rustu
omer rustu el 3 de Jun. de 2023
Respondida: Dyuman Joshi el 3 de Jun. de 2023
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?

Respuestas (1)

Dyuman Joshi
Dyuman Joshi el 3 de Jun. de 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)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by