![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280051/image.png)
Plot 3D Vector
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Burak Alakus
am 27 Mär. 2020
Kommentiert: Burak Alakus
am 27 Mär. 2020
Hello guys,
I want to plot the given example with MATLAB yet i can not do that. Can you guys help me?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280043/image.png)
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 27 Mär. 2020
Bearbeitet: Ameer Hamza
am 27 Mär. 2020
Try this
ax = axes();
view(ax,[-120 30]);
grid on;
hold(ax);
ax.XDir = 'reverse';
ax.YDir = 'reverse';
ax.XLim = [0 8];
ax.YLim = [0 8];
ax.ZLim = [0 8];
ax.XTick = 0:2:8;
ax.YTick = 0:2:8;
ax.ZTick = 0:2:8;
origin = [2 2 0];
xaxis = [3 2 0];
yaxis = [2 1 0];
zaxis = [2 2 1];
plot3([origin(1) xaxis(1)], [origin(2) xaxis(2)], [origin(3) xaxis(3)], 'r', ...
'LineWidth', 3);
plot3([origin(1) yaxis(1)], [origin(2) yaxis(2)], [origin(3) yaxis(3)], 'b', ...
'LineWidth', 3);
plot3([origin(1) zaxis(1)], [origin(2) zaxis(2)], [origin(3) zaxis(3)], 'g', ...
'LineWidth', 3);
text(ax, 2.2, 1.7, 0, 'A');
xlabel('x-ekseni');
ylabel('y-ekseni');
zlabel('z-ekseni');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280051/image.png)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!