필터 지우기
필터 지우기

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