This example shows two formatting operators and six values to insert into the output text: sprintf('%s = %d\n', 'A', 479, 'B', 352, 'C', 651) ans = A = 479 B = 352 C = 651 You can also specify multiple value arguments as a vector or matrix. The sprintf command works in nearly the same way as the fprintf command, only instead of sending characters to the screen or to a file, sprintf sends them into a MATLAB variable. print (filename,formattype) saves the current figure to a file using the specified file format, such as print ('BarPlot','-dpng'). ![]() The function sprintf puts the formatted output in a string. In fact the number of arguments reflect - simply speaking - the number of % -constructs in the string formatSpec. ![]() 14/22 The specified format applies only to the current MATLAB session. none sprintf is the same as fprintf except that it returns the data in a MATLAB string variable rather than writing it to a file. help whos Note that Matlab help is also available in html format by using the menu bar at the top of the desktop.
0 Comments
Leave a Reply. |