How to put limit in my code?

조회 수: 4 (최근 30일)
Sagar Chawla
Sagar Chawla 2021년 9월 21일
댓글: Sagar Chawla 2021년 9월 22일
for i=1:length(a) subplot(2,2,1),scatter3(a(i),x(i),y(i),'o','linewidth',1);
subplot(2,2,2),scatter3(a(i),y(i),z(i),'o','linewidth',1);
subplot(2,2,3),scatter3(a(i),z(i),x(i),'o','linewidth',1);
hold on
subplot(2,2,1),scatter3(a(1:i),x(1:i),y(1:i),'linewidth',1);
title('a vs x vs y');
xlabel('a');
ylabel('x');
zlabel('y');
subplot(2,2,2),scatter3(a(1:i),y(1:i),z(1:i),'linewidth',1);
title('a vs y vs z');
xlabel('a');
ylabel('y');
zlabel('z');
subplot(2,2,3),scatter3(a(1:i),z(1:i),x(1:i),'linewidth',1);
title('a vs z vs x');
xlabel('a');
ylabel('z');
zlabel('x');
F(i)=getframe(gcf);
pause(0.01);
if i~=length(a)
clf
end
end
video=VideoWriter('test.avi');
video.FrameRate = 6;
open(video)
writeVideo(video,F)
close(video)
  댓글 수: 2
Image Analyst
Image Analyst 2021년 9월 21일
편집: Image Analyst 2021년 9월 21일
I don't know what "limit" means to you. And what are a, x, y, and z?
Sagar Chawla
Sagar Chawla 2021년 9월 22일
As I am trying to animate the graph with the help of excel data. I want to stop the coordinates of the graph like x should be (-2 25 ). Time -a, x, y, z- distance

댓글을 달려면 로그인하십시오.

답변 (1개)

Viranch Patel
Viranch Patel 2021년 9월 22일
If I have got the question correctly, then these functions may solve your query.
xlim([x_min x_max])
ylim([y_min y_max])
zlim([z_min z_max])
  댓글 수: 1
Sagar Chawla
Sagar Chawla 2021년 9월 22일
I have tried this like xlim([-2 45]) and all. But it is giving an error. The graph is not showing any values.

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by