How to plot vector in app designing
4 ビュー (過去 30 日間)
古いコメントを表示
I want to plot vectors in Appdesign but it is showing 2D plot instead of 3D plot. Please help me ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1306700/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1306700/image.png)
0 件のコメント
回答 (1 件)
dpb
2023 年 2 月 25 日
移動済み: dpb
2023 年 2 月 25 日
How would you propose to plot in 3D just vector data? And, of course, plot is only a 2D x-y plotting routine; it knows nothing else so if you call it, that's definitely what you're going to get.
The call
plot(app.UIAxes,v1)
doesn't even have an x-coordinate supplied to it; it treats the values in v1 as the y values and plots them against the ordinal postiion (1:numel(v1)).
What are you trying to achieve here? Draw us a sketch of what you think the result should be from a given set of data.
Well, let's take a guess...we don't have the gui, but we can duplicate the data you show ---
v1=1:3;v2=2:4;v3=v1+v2; % reproduce the vectors shown
hL=plot3(v1,v2,v3,'x-'); % draw a 3D line from them, show the points
xlabel('x'),ylabel('y'),zlabel('z')
grid on % help visualization with grid
xlim([0 4]),ylim([1 5]),zlim([2 8]) % and set range to be outside the data values so not on axes
That more what you had in mind?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!