How would i write this str?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
how would i format this,
MyAge = 6
FreindName = 'Joe'
FreindAge = 4
disp(['My',' friend',"'",'s', ' age is', FreindAge, ' years.'])
im trying to get it to display 'My freind's age is (veriable) years'
0 Kommentare
Antworten (1)
Image Analyst
am 6 Dez. 2023
I always use fprintf
MyAge = 6;
FreindName = 'Joe';
FreindAge = 4;
fprintf("My friend %s's age is %d years.\n", FreindName, FreindAge)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!