Create comma-separated list from data of UITable
Mostrar comentarios más antiguos
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 comentarios
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
el 14 de Mayo de 2022
Editada: Beth Carreon
el 14 de Mayo de 2022
dpb
el 14 de Mayo de 2022
See the Answer...as expected, this can be simplified greatly by proper use of data types and storage.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Timetables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

