User Tools

Site Tools


gibson:teaching:spring-2016:math445:lecture:forloop

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 lecture 7: the "for" loop, fprintf ====== ===== Formatted printing with fprintf ===== **fprintf** is Matlab's **formatted print function**. It's used for printing variables to the screen (or files) in a format that you specify. The basic syntax is <code matlab> fprintf("format-string", variable, variable, variable, ...) </code> but it is really best illustrated by example. <code matlab> >> w = 'perambulate'; >> n = length(w); >> fprintf('The word %s has %d letters.\n', w, n) The word perambulate has 11 letters. </code> ===== for loops =====

gibson/teaching/spring-2016/math445/lecture/forloop.1455558306.txt.gz · Last modified: 2016/02/15 09:45 by gibson