Unformatted text preview: example1.m . M±les are text ±les and may be created and modi±ed with any text editor. You need to know how to open, edit, and save a ±le with the text editor you are using. On a PC or Macintosh, an Mfle editor may be brought up by choosing New from the File menu in the Matlab Command window and selecting Mfle . The script M±le is executed by choosing Run Script. .. from the File menu on a PC or Macintosh, or simply typing the name of the script ±le at the prompt in the Matlab command window. Example 3.2 Quadratic root fnding script Create the ±le named qroots.m in your present working directory using a text editor: % qroots: Quadratic root finding script format compact; a=1 b=5 c=6 x = b/(2*a); y = sqrt(b^24*a*c)/(2*a); s1 = x+y s2 = xy To execute the script M±le, simply type the name of the script ±le qroots at the Matlab prompt: >> qroots a = 1 b = 5 c = 43...
View
Full Document
 Summer '09
 CHANG
 English, matlab, Want, Comparison of text editors, Matlab prompt

Click to edit the document details