필터 지우기
필터 지우기

3d plot with x value being constant

조회 수: 3 (최근 30일)
Darren Marcelino
Darren Marcelino 2022년 12월 13일
댓글: Darren Marcelino 2023년 1월 20일
im trying to plot a point on a 3d plot but i keep coming up with the error
Error using plot3
Vectors must be the same length.
Error in threed_suspension (line 50)
plot3(Lowerx,Lowery,Lowerz,'b')
I dont know how to keep p5x constant while p5y and p5z a changing variable.
p5y(i)= RL*cosd(LowerTheta(i));
p5z(i)=RL*sind(LowerTheta(i)); %parallel
z=size(LowerTheta);
p5x= p1x*z;
Lowerx=[p1x,p5x];
Lowery=[p1y,p5y(i)];
Lowerz=[p1y,p5z(i)];
plot3(Lowerx,Lowery,Lowerz,'b')
plot3(p5x,p5y,p5z,'*r')

채택된 답변

Askic V
Askic V 2022년 12월 13일
p5x= p1x*ones(z);
  댓글 수: 4
Askic V
Askic V 2022년 12월 13일
Did you try this?
%p5 lower arm member
p5y(i)= RL*cosd(LowerTheta(i));
p5z(i)=RL*sind(LowerTheta(i)); %parallel
p5x(i) = p1x;
Lowerx=[p1x,p5x(i)];
Lowery=[p1y,p5y(i)];
Lowerz=[p1y,p5z(i)];
I'm not really sure what you want to do, but if you need p5x to be constant, just assign it value just like on y and z component.
Darren Marcelino
Darren Marcelino 2023년 1월 20일
I ended up figuring that spherical coordinates are easier to manipulate and keep stuff constant. i rewrote my code using spherical coordinates. i found it easier. i had to do extra trig to figure out angles but i found that if you are trying to keep a length constant, one end of it is pinned. (360 freedom of movement) , and the other end is moving in the 3d space, spehrical coordinates are best to use.
https://www.mathworks.com/help/phased/ug/spherical-coordinates.html

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by