Extract data from UIAxes in AppDesigner
Show older comments
Hello, I'm devolping an app in AppDesigner and I want to extract data from a UIAxes.
I have several different actions before I can extract the data. I wanna press a button, after all those actions are done, and extract the data from what is plotted in the UIAxes.
Any suggestions?
Answers (1)
Eric Delgado
on 26 Sep 2022
If you are using lines, you just have to call "XData", "YData" and "ZData" of your uiaxes's childrens. For example:
>> plot(app.UIAxes, randn(1001,1));
>> app.UIAxes.Children
ans =
Line with properties:
Color: [0 0.4470 0.7410]
LineStyle: '-'
LineWidth: 0.5000
Marker: 'none'
MarkerSize: 6
MarkerFaceColor: 'none'
XData: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 … ]
YData: [1.6302 0.4889 1.0347 0.7269 -0.3034 0.2939 -0.7873 0.8884 -1.1471 -1.0689 -0.8095 -2.9443 1.4384 0.3252 -0.7549 1.3703 -1.7115 -0.1022 -0.2414 … ]
ZData: [1×0 double]
>> ax.Children.XData(1:10)
ans =
1 2 3 4 5 6 7 8 9 10
1 Comment
Vassilios Bezzerides
on 27 Sep 2024
This does not work with 2021b
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!