displaying text before answer
86 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
So I made a function on matlab but i want matlab to display 'the answer is' text and then the answer . How am I suppose to do that? I think I have to use disp code but I couldn't figure how.
0 Kommentare
Antworten (2)
Walter Roberson
am 10 Nov. 2019
Bearbeitet: Walter Roberson
am 10 Nov. 2019
Use fprintf() using a format that does not end in \n if you want to display something without going to the next line after.
0 Kommentare
Sarvesh Kale
am 9 Mär. 2023
refer to the following code
x = 3.14 ;
fprintf("The value of pi is %f \n",x); % this will print the answer in your required format
I hope this helps
0 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown 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!