Borrar filtros
Borrar filtros

Creating solid 3d object

8 visualizaciones (últimos 30 días)
zohar
zohar el 13 de Abr. de 2011
Dear all matlab users,
I want to generate solid 3d object
n = 100;
a=1;
% r const
teta = linspace(0,pi/2,n);teta =teta';
phi = linspace(0,pi/2,n);
r=1;
x = r.*sin(teta)*cos(phi) ;
y = r.*sin(teta)*sin(phi) ;
z = r.*cos(teta)*ones(1,n);
figure;plot3(x,y,z,'or');grid minor
% phi const
teta = linspace(0,pi/2,n);
r = linspace(0,a,n);r=r';
phi = pi/4;
x = r*sin(teta)*cos(phi);
y = r*sin(teta)*sin(phi);
z = r*cos(teta);
figure;plot3(x,y,z,'or');grid minor
Now I want to combine thos variables so it would be solid 3d object
I don't want to use for loop.
I think the solution should be somthing like,
multiply of a horizontal 2d matrix by vertical 2d matrix
and multiplication result is 3d matrix.
Any help would be appreciated...

Respuestas (1)

Walter Roberson
Walter Roberson el 13 de Abr. de 2011
MATLAB does not have any built-in 3D matrix multiplication.

Categorías

Más información sobre Matrices and Arrays 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