This shows you the differences between two versions of the page.
| gibson:teaching:fall-2013:math445:lecture13 [2013/10/16 18:56] gibson created | gibson:teaching:fall-2013:math445:lecture13 [2013/10/16 18:56] (current) gibson | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| x = 3; | x = 3; | ||
| y = 7; | y = 7; | ||
| + | |||
| % fprintf substitutes the values of the listed variables into the | % fprintf substitutes the values of the listed variables into the | ||
| Line 20: | Line 21: | ||
| fprintf('The values of x is %f and the value of y is %d\n', x, y); | fprintf('The values of x is %f and the value of y is %d\n', x, y); | ||
| The values of x is 3.000000 and the value of y is 7 | The values of x is 3.000000 and the value of y is 7 | ||
| + | |||
| % An example of fprintf with a string, using %s in the format string | % An example of fprintf with a string, using %s in the format string | ||