![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/189761/image.png)
How do you use the plot3 function with an interval?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have three functions. They are x = (3+5*cos(t))*cos(t), y = (3+5*cos(t))*sin(t), and z = 2*t^2. I have to create a script that uses the plot3 function to plot the position for 0 ≤ t ≤ 30sec in increments of 0.1sec. How would you go about doing this?
댓글 수: 0
답변 (1개)
Basil C.
2018년 7월 4일
You could try to run the following code
t=1:0.1:30;
x = 3*cos(t)+5*cos(t).^2;
y = 3*sin(t)+ 5/2*sin(2*t);
z = 2*t.^2;
figure
plot3(x,y,z)
I have eleminated the use of * operator and used basic trignometric formulae and this was the plot i obtained
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/189761/image.png)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!