User:Eml4500.f08.ateam.shah/Section13

Section 13: Text strings, error message, input
Text strings can be entered into Matlab using single quotations. These strings can be displayed by using the disp command.

Ex:  s= ‘peter pan had an accident’

disp(‘peter pan had an accident’)

Error messages that are placed in M-files can abort the program.

Ex:

error(‘Sorry, this matrix is wrong’)

Strings can also be added into an M-file to make the program interactive.

Ex:

iter = input(‘Enter the number of times you want to enter a number:’)