fprint problem in matlab
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
why the outstr value is 24 here ?
0 comentarios
Respuestas (1)
Star Strider
el 2 de Jun. de 2020
The fprintf fuction returns the number of bytes ouitput to the file.
2 comentarios
Star Strider
el 2 de Jun. de 2020
In the code in your image of it (not the actual code, that I had to type in manually), the value is in ‘outstr’. It writes 24 bytes to the file, and the full string to your Command Window (the default output), returning 24 in ‘outstr’.
If you want it to return the actual string to your workspace, use:
outstr = sprintf('The answer is %s', data1);
That works. (I tested it.)
Ver también
Categorías
Más información sobre Graph and Network Algorithms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!