How to plot from a specific point?
6 ビュー (過去 30 日間)
古いコメントを表示
Hello, I have a rather simple issue that I can't seem to figure out. I have a vector
Vector=[20;50;0];
Which I'd like to plot from this point
Traslacion=[10;-15;10];
Yet I don't know if there's an option for this. Any help would be appreciated
3 件のコメント
Sam Chak
2024 年 3 月 7 日
Hi @Patricio Flores García, Can you sketch on a piece of paper, or use your PC or smartphone to edit the image by drawing the desired vector?
回答 (2 件)
Voss
2024 年 3 月 7 日
Vector=[20;50;0];
Traslacion=[10;-15;10];
XYZ = [Vector,Traslacion];
plot3(XYZ(1,:),XYZ(2,:),XYZ(3,:),'r','LineWidth',3)
box on
grid on
view(-31,35)
3 件のコメント
Voss
2024 年 3 月 7 日
編集済み: Voss
2024 年 3 月 7 日
Vector=[20;50;0];
Traslacion=[10;-15;10];
Like this?
figure();
XYZ = Vector+[[0;0;0] Traslacion];
plot3(XYZ(1,:),XYZ(2,:),XYZ(3,:),'r','LineWidth',3)
box on
grid on
view(-31,35)
Or this?
figure();
XYZ = Traslacion+[[0;0;0] Vector];
plot3(XYZ(1,:),XYZ(2,:),XYZ(3,:),'r','LineWidth',3)
box on
grid on
view(-31,35)
Fangjun Jiang
2024 年 3 月 7 日
編集済み: Fangjun Jiang
2024 年 3 月 7 日
Use line(), you need to put the data in the right format. See help document
Vector=[20;50;0];
Traslacion=[10;-15;10];
d=[Traslacion Vector]
line(d(1,:),d(2,:),d(3,:))
view(3);grid on;
2 件のコメント
Fangjun Jiang
2024 年 3 月 7 日
Vector=[20;50;0];
Traslacion=[10;-15;10];
d=[zeros(3,1),Traslacion, Vector];
line(d(1,:),d(2,:),d(3,:))
view(3);grid on;
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!