필터 지우기
필터 지우기

Plotting in 3d

조회 수: 1 (최근 30일)
Philosophaie
Philosophaie 2017년 10월 9일
답변: KSSV 2017년 10월 10일
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;

답변 (1개)

KSSV
KSSV 2017년 10월 10일
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.

카테고리

Help CenterFile Exchange에서 Argument Definitions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by