combine numbers and symbols in print to txt file
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I want to print a matrix
My input are:
LatLon=[ 57 42.682 10 36.159;
57 42.841 10 36.049......]
I want to print the output to a txt file to look like this.
Latdeg Latmin Londeg Lonmin
57 (Degrees sign) 42.682'N 10 (degrees sign) 36.159'E
57(degrees sign) 42.841'N 10 (degrees sign) 36.049'E
The degrees sign should be ^o .
0 commentaires
Réponses (1)
Krishna Zanwar
le 25 Fév 2019
Hi Peter,
Use the File Id of your text file instead of <fileId>
a = "%d ";
b=char(176);
c=" %f'N %d";
d=" %f'E \n";
formatSpec=strcat(a,b,c,b,d)
fprintf(<fileId>,formatSpec,LatLon(:,1),LatLon(:,2),LatLon(:,3),LatLon(:,4))
Voir également
Catégories
En savoir plus sur Environment and Settings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!