diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m index 1fd806a3a4f4bc9bdba4d55a4e8e0396ec685abc..91bbbd7ef216a0b347e487f9b44f60c528b3f8e1 100644 --- a/tsgqc_GUI.m +++ b/tsgqc_GUI.m @@ -580,14 +580,16 @@ function tsgqc_GUI if x > tsg.TIME(1) && x < tsg.TIME(end) indCursor = find( tsg.TIME > x); - + % use sprintf with format instead strcat & num2str but flag + % - don't work with 0, eg %+07.4f set( hInfoText, 'String',... - strcat(... - datestr(tsg.TIME(indCursor(1)),'dd mmmm yyyy'),... - ' - Latitute = ', num2str(tsg.LATITUDE(indCursor(1))), ... - ' - Longitude = ', num2str(tsg.LONGITUDE(indCursor(1))), ... - ' - Salinity = ', num2str(tsg.PSAL(indCursor(1))), ... - ' - Temperature = ', num2str(tsg.TEMP_TSG(indCursor(1)))... + sprintf(['%s - Latitude = %07.4f - Longitude = %08.4f '... + ' - Salinity = %07.4f - Temperature = %07.4f'],... + datestr(tsg.TIME(indCursor(1)),'dd/mm/yyyy'),... + tsg.LATITUDE(indCursor(1)), ... + tsg.LONGITUDE(indCursor(1)), ... + tsg.PSAL(indCursor(1)), ... + tsg.TEMP_TSG(indCursor(1))... )); % Plot the position on the map if this one is active