Borrar filtros
Borrar filtros

Plotting in 3d

1 visualización (últimos 30 días)
Philosophaie
Philosophaie el 9 de Oct. de 2017
Respondida: KSSV el 10 de Oct. de 2017
I cannot put all of the plot into one window. How do I plot in 3D?
v=3E8;
f=760E12;
x=zeros(400);
y=zeros(400);
z=zeros(400);
xx=zeros(400);
yy=zeros(400);
for tstep=1:360
t=tstep*1e-4;
x(tstep)=v*t;
y(tstep)=v/f*cos(tstep*pi/180);
z(tstep)=v/f*sin(tstep*pi/180);
xx(tstep)=(x(t)-y(t)*cos(45*pi/180));
yy(tstep)=z(t)-y(t)*sin(45*pi/180);
hold on;
plot(xx(tstep),yy(tstep),'-b');
end;
hold off;

Respuestas (1)

KSSV
KSSV el 10 de Oct. de 2017
v=3E8;
f=760E12;
x=zeros(400);
y=zeros(400);
z=zeros(400);
xx=zeros(400);
yy=zeros(400);
for tstep=1:360
t=tstep*1e-4;
x=v*t;
y=v/f*cos(tstep*pi/180);
z=v/f*sin(tstep*pi/180);
xx(tstep)=(x-y*cos(45*pi/180));
yy(tstep)=z-y*sin(45*pi/180);
hold on;
plot(xx(tstep),yy(tstep),'.b');
end
hold off;
Can be achieved without loop also.

Categorías

Más información sobre Argument Definitions 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