Extract data from UIAxes in AppDesigner

조회 수: 8 (최근 30일)
Bruno Neto
Bruno Neto 2022년 9월 23일
댓글: Vassilios Bezzerides 2024년 9월 27일
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