Combine fprintf and disp
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Niklas Reinshagen
il 19 Giu 2020
Commentato: Ameer Hamza
il 19 Giu 2020
Hey all together!
I'm writing a code but be a littler confused because basicly I have to combine fprintf and disp...
fprintf('\nSite name: disp(name(1:4))) \n')
So I'm using a fprintf to print this line of Strings: Site Name: and after this, there shoul'd be written the first 4 letters from my File, i insert this function. Is ist somehow possible to write it this way? I allways get an error... :-(
0 Commenti
Risposta accettata
Ameer Hamza
il 19 Giu 2020
disp() is not needed here.
fprintf('\nSite name: %s \n', name(1:4))
See the documentation of fprintf for detail of the formating string.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!