Filter löschen
Filter löschen

How to plot vector in app designing

4 Ansichten (letzte 30 Tage)
Abrar
Abrar am 25 Feb. 2023
Verschoben: dpb am 25 Feb. 2023
I want to plot vectors in Appdesign but it is showing 2D plot instead of 3D plot. Please help me

Antworten (1)

dpb
dpb am 25 Feb. 2023
Verschoben: dpb am 25 Feb. 2023
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...

Kategorien

Mehr zu Graphics Object Properties 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!

Translated by