MATLAB: I have a n*m matrix which all elements strings. I wanna put particular character above on these columns.

set.handlesstring

num1=[1;2;3] %points id
num2=[30.45;32.55;33.85] %points latitudes
num3=[40.55;41.22;43.62] %points longitudes
num=[num1 num2 num3] %points id, latitude longitude
num=num2str(num)
set(handles.listbox1, 'String', num) %to write into the listbox in the GUI
%I wanna put "Point_İd- Latitude and Longitude" in the first row of this matrix and write this matrix in the listbox.
Point_İd Latitude Longitude
1 30.45 40.55
2 32.55 41.22
3 33.85 43.62 %that's the structure I wanna put in the listbox (or other GUI button you want).
%Values belongs to "Point_İd Latitude Longitude" are variable so sometimes these values slides towards the right edge of the listbox,
%for example;
Point_İd Latitude Longitude
1056756 30.455665 40.557876
2678788 32.558877 41.229899
3667899 33.859988 43.627666
%like this, what should I do to sustain vertical rows without sliding?

Best Answer

Use sprintf() to create your strings. Then use set(handles.textControl1, 'String', theText) to sned the string to the text label control.