필터 지우기
필터 지우기

How can i select cell from table in app designer?

조회 수: 25 (최근 30일)
Özge
Özge 2020년 6월 6일
댓글: J. Alex Lee 2020년 6월 10일
I read the location information history and earthquake magnitude of earthquakes from an excel file. You can see it in the photo I added. I want to take any one line from this map with a lot of data and show the latitude longitude here on the map. How can I do that?
function Button2Pushed(app, event)
t = readtable('earthquakes.xlsx','Sheet',1);
app.UITable.Data = t;
end

답변 (1개)

J. Alex Lee
J. Alex Lee 2020년 6월 7일
The UITable has a callback for selection
The event callback contains the indices of the selected cell, so you could use the row index to extract the relevant data from the actual data table (which you will have to make available within the app, as by creating a property to hold it).
You probably want to load the data from excel once with app start up, instead of on a button push...?
  댓글 수: 10
Özge
Özge 2020년 6월 9일
So how do I see this latitude and longitude value in the command window?
J. Alex Lee
J. Alex Lee 2020년 6월 10일
if you run the app in the command line with an output
>> app = MyAppName()
then you can access any public properties you defined:
>> app.Latitude
Is that what you are asking?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by