+2 votes
429 views

I have used them but same output !

Whats the difference between them fprintf and sprintf ?

asked May 24, 2016 in Computer Science - IT by techdoubt | 429 views
Good Question +1

1 Answer

+1 vote
Best answer

Yes, they seem to have same behavior but there is a difference :

fprintf prints the variable in a command window or a file, 


but in case of sprintf , they can be used to create a string ,

returns the results to character vector str

Example  :

Official documentation :

http://in.mathworks.com/help/matlab/ref/fprintf.html

http://in.mathworks.com/help/matlab/ref/sprintf.html

 

answered May 28, 2016 by slow_learner
selected May 31, 2016 by techdoubt