how to fprintf and disp on the same line
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fawzeya bin tamim
am 23 Nov. 2020
Kommentiert: fawzeya bin tamim
am 23 Nov. 2020
i want this code to display 3 things on the same line but instead, i get this:
The number of capacitance should be 2
, i.e., 1/2 numbers of inductors
fprintf('The number of capacitance should be'); disp((length(inductance))/2); fprintf(', i.e., 1/2 numbers of inductors\n');
0 Kommentare
Akzeptierte Antwort
Nora Khaled
am 23 Nov. 2020
disp always starts new line afterward.
you should only use fprintf and '\n' if you want to end the line
fprintf('The number of capacitance should be %f , i.e., 1/2 numbers of inductors\n',(length(inductance))/2)
use either %f or %d if the number is integer or float
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Printing and Saving 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!