how to plot a 3d evenly spaced grid

code is:
clc
clear variables
close all
theta=-pi/6:pi/180:pi/6;
phi=-pi/6:pi/180:pi/6;
[theta,phi]=meshgrid(theta,phi);
for rho=5:0.025:50
[x,y,z]=sph2cart(theta,phi,rho);
mesh(x,y,z,'edgecolor','g');
hold on
xs=linspace(min(x(:)),max(x(:)),61);
ys=linspace(min(y(:)),max(y(:)),61);
zs=linspace(min(z(:)),max(z(:)),61);
end
how to plot xs,ys and zs according to non-uniform spacing grid x,y and z

5 comentarios

KSSV
KSSV el 28 de Mayo de 2019
Question is not clear.....
VANDANA GUPTA
VANDANA GUPTA el 28 de Mayo de 2019
sir, i made a 3-d grid by meshing of x,y and z..this grid has non-uniform spacing so for better visualizaion, i want to make a uniform spacing grid..for this i took the range of x,y and z..then i used linsapce to make evenly spaced range..sir i plot this range (xs,ys and zs) like
[xs1,ys1]=meshgrid(xs,ys);
[zs1,zs2]=meshgrid(zs);
mesh(xs1,ys1,zs1,'edgecolor','r');
evenly spaced grid has shown but this evenly spaced grid has not been full covering the non-uniform spacing grid..i have tried in many ways but i have not been getting the solution
VANDANA GUPTA
VANDANA GUPTA el 28 de Mayo de 2019
i mean to say that i want to make a evenly spaced grid which covers the non-uniform grid in 3-d as like as i have done this task ''(gr.jpg)'' in 2-d
KALYAN ACHARJYA
KALYAN ACHARJYA el 28 de Mayo de 2019
Editada: KALYAN ACHARJYA el 28 de Mayo de 2019
I have checked the attached image. Are you looking for change the grid size?
VANDANA GUPTA
VANDANA GUPTA el 28 de Mayo de 2019
sir , i want to make the uniform grid for non-uniform grid as fully cover the non-uniform grid like i made in 2-d..i dont know it will get by change the grid size..i got the non-uniform grid ''nu.jpg'' and evenly spaced grid ''ev.jpg'' from above given code.. when i hold on both two grids then they are looking as ''cg.jpg''. the green is non-uniform and the red is uniform..

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Mayo de 2019

Comentada:

el 28 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by