Create comma-separated list from data of UITable
이전 댓글 표시
I want to create a list of latitude just like the format below from a UITable
latitudes = [lat1, lat2, lat3,...];
This is the data from the UITable.

I am getting this result using the following code, clearly with no commas.
m = horzcat(app.UITable.Data{:,3})
m =
'13.9524380813.9524398613.95226986 13.9475104713.94693600'
Does anyone know how to do this? Thanks
댓글 수: 3
The simpler way would be to set the 'ColumnFormat' property to 'Double' and write a callback routine if it is editable and user enters bum data...then the .Data property will return numeric data automagically.
There is no reason to build a list of the sort used for user input physically; it won't be useful programmatically even if you do; it will be a string or cellstr, not actually a list, anyway. Passing the double array will be the way to use the results in any function or even to output if that is the end objective...you don't provide any context for why you think you need to do this, so we don't have any way to know what possilbly could be the best way to resolve whatever led you to this point, but it's a strong likelihood the above will be it.
See the details available uitable links to 'Table Properties' and the examples include showing callback functions.
Beth Carreon
2022년 5월 14일
편집: Beth Carreon
2022년 5월 14일
dpb
2022년 5월 14일
See the Answer...as expected, this can be simplified greatly by proper use of data types and storage.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Timetables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

