how can I create meshgrid of given data?

3 views (last 30 days)
I have successfully created 7*7 meshgrid of given three types of data, which is given below
ecc=(.018:.001:.024) ;
theta = (-3:1:3);
[e, ph, th] = meshgrid(ecc,phi,theta)
But i am getting error while creating 6*6 meshgrid of given 4 types of data, which is given below
rad=(.009:.001:.014) ;
phi = (35:1:40);
[T, r, e, ph] = meshgrid(temp,rad,ecc,phi);
how can i solve this? please help me with corrected code.

Accepted Answer

Torsten on 24 Apr 2022
Use "ndgrid" instead of "meshgrid".
"meshgrid" is for 2d- and 3d-grids.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!