필터 지우기
필터 지우기

How to plot selected columns from UITable in app designer (2019b)?

조회 수: 12 (최근 30일)
Ihab Abboud
Ihab Abboud 2020년 5월 19일
댓글: Ameer Hamza 2020년 5월 19일
I have created an app using designer app that displays data in a UITable. I want the user to select two columns then plot them. I have figured out how to keep track of the selected indices and get the selected columns out of that.
I tried this
T = app.UITable.Data;
plot(T(:,app.ColumnsSelected(1)),T(:,app.ColumnsSelected(2)));
The problem here is that T(:,app.ColumnsSelected(1or2)) is a table so plot gives an error because it doesn’t plot tables
I have been trying this for a while now without success.
Thanks

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 19일
편집: Ameer Hamza 2020년 5월 19일
Use brace indexing
plot(app.UIAxesName, T{:,app.ColumnsSelected(1)},T{:,app.ColumnsSelected(2)});
Also, note that first input to plot shoule be the handle to UIAxes.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by