fprintf help wont show full statement
    6 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
fprintf("afunc*bfunc gives us %d therefore is a root between 0 and 5 \n', rootproof") 
%gives the output 
afunc*bfunc gives us >> 
where have i gone wrong?
5 Kommentare
  Stephen23
      
      
 am 8 Nov. 2019
				Original question:
fprintf("afunc*bfunc gives us %d therefore is a root between 0 and 5 \n', rootproof") 
%gives the output 
afunc*bfunc gives us >> 
where have i gone wrong?
Antworten (1)
  Rik
      
      
 am 31 Okt. 2019
        Simply pasting what you posted into my copy of Matlab gives a hint about the cause:
I get a warning from m-lint (the orange squiggle) that states that "The format might not agree with the argument count".
The reason is that you made the entire input a string, instead of only the format specifier. Do not mix single and double quotes. Either of the versions below will work.
rootproof=3;
fprintf("afunc*bfunc gives us %d therefore is a root between 0 and 5 \n", rootproof)
fprintf('afunc*bfunc gives us %d therefore is a root between 0 and 5 \n', rootproof)
2 Kommentare
Siehe auch
Kategorien
				Mehr zu Entering Commands 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!




