Visualizing figure in app designer

2 Ansichten (letzte 30 Tage)
Michal
Michal am 15 Sep. 2023
Beantwortet: Adam Danz am 15 Sep. 2023
Hi I have a function in callback of app designer that returns few figures. How do i plot them in UIAxes. I know that it is possible to use plot(app.UIAxes, x, y) but I havent got access to x and y coordinates of this figure.
Thank you for all your help
  6 Kommentare
Adam Danz
Adam Danz am 15 Sep. 2023
> plot(ax2,XYVAL(:,1),XYVAL(:,2));
Those are the x and y coordinates. Why don't you have access to them?
Michal
Michal am 15 Sep. 2023
my function generateTrack returns only the figure not the coordinates. It possible to access this x, y coordinates from the figure level or i need to change the function so that it would return coordinates?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Adam Danz
Adam Danz am 15 Sep. 2023
> Is it possible to access this x, y coordinates from the figure level or do I need to change the function so that it would return coordinates?
It's possible to extract the data from the figure but it's much better to return the values from the function.
function [___, x, y] = generatTrack(__)
...
x = XYVAL(:,1);
y = XYVAL(:,2);
plot(ax2,x,y);
end
or
function [___, XYVAL] = generatTrack(__)
...
plot(ax2,XYVAL(:,1),XYVAL(:,2));
end

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks 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