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!

