meshgrid() confusion (dimesions, index,...)
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
carmen
el 15 de Feb. de 2012
Hello everybody, i have a fundamental question on the meshgrid() function. I have a 10x20x30 cubus of scalar data. i wanted to save the x,y- and z coordinates of these points in real space to 3 matrices coordX coordY and coordZ. i tried
[ccordX coordY coordZ]=meshgrid(xmin:xmax, ymin:ymax, zmin:zmax)
and got a horrible mess, since size(coordX) turns out as [20,10,30]. Does anybody know what my mistake is? thanks! carmen
0 comentarios
Respuesta aceptada
Andrei Bobrov
el 17 de Feb. de 2012
can so?
[ccordX coordZ coordY]=meshgrid(xmin:xmax, zmin:zmax, ymin:ymax)
ADD
[ccordZ coordX coordY]=ndgrid(zmin:zmax, xmin:xmax, ymin:ymax)
eg
yourcubus = randi(150,4,5,3)
x = linspace(0,300,s(2))
y = linspace(0,250,s(3))
z = linspace(0,250,s(1))
[ccordZ coordX coordY]=ndgrid(z,x,y)
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Detection en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!