How to plot vector in app designing

4 次查看(过去 30 天)
Abrar
Abrar 2023-2-25
移动dpb 2023-2-25
I want to plot vectors in Appdesign but it is showing 2D plot instead of 3D plot. Please help me

回答(1 个)

dpb
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?
See <plot3> for all the details and options in using it...

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by