Extract data from UIAxes in AppDesigner

7 次查看(过去 30 天)
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?

回答(1 个)

Eric Delgado
Eric Delgado 2022-9-26
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

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by