|
|
xxxxxxxxxxxxxxxxxx |
INSTALLING OCTAVE 3.0 ON YOUR PC1) Download the installation file by clicking the link below:
Window:
octave-3.0.1-setup.exe Either save it to a temporary location and then execute it or else execute the program immediately during the download process. You start the program by clicking the startup icon and waiting for the prompt to appear. You then can just start entering statements into Octave by typing expressions and then clicking the enter key:
That last command "exit" will close the Octave window and end the program. 3) By default, Octave will look for your program code in the folder C:\Program Files\Octave You want to create a better location for your files. A good solution is to create a folder "Octave Programs" in your "My Documents" folder. Next you need to make this folder the current working directory in Octave. This can be done at startup by using the change directory command cd as follows for Windows XP:
For Windows Vista this would be:
The best method is to have the system automatically make this change for you by editing the properties of the desktop startup icon. To do this right click the startup icon, click "Properties" and then edit the "Start In:" folder to be your code folder. The next time you start Octave the working directory will be the one you entered in the "Start In:" field. You can check whether this is the case by using the pwd command as above. 4) The default text editor for writing octave code is the SciTE program and you can copy a startup link to your desktop also. It is located at C:\Program Files\Octave\tools\wscite\SciTE.exe This last step may not be necessary since the Windows system will associate this editor with text file with the m-extension. Thus, if you create an empty plain text file in your code folder (Step 2) with the name test.m then double clicking this file icon will open the editor. At that point you can use the File/Save As option to rename it. 5) To test your system create the file test.m in Step 4 and enter the single statement disp('Hello World!') and then Save your changes. Next double-click the Octave startup on your desktop and enter the statement 'test' followed by the Enter key. Here's what should happen:
Alternately, you can just enter statements directly into Octave by typing say:
The preferred method of writing code is to use a source file (as above) and then test the code in Octave. When something is not right you should modify the source file, save the changes and repeat the testing step. Nevertheless, any code statement can be entered directly into Octave for testing purposes or for doing very simple examples. 6) To get started with programming read over the introductory material in the Octave Manual. Another way to get started is to skim over the MatLab Getting Started Manual starting with Chap 3 and Chap 5. The Matlab system has a completely different interface than Octave but the MatLab Command window is very similar to the Octave system language:
Octave Manual (378 page PDF) Octave and MatLab are quite compatible and with a little care one can write programs that will simultaneously work with either system. In addition, MatLab has an extensive website to help you learn their programming language, see MatLab Programming Online Help 7) It is possible to paste code into the command line and to copy portions of the command window for use in text files. Here's how you do that:
The reverse process of pasting a command into Octave is done by first copying the command to the clipboard from a file or web page. Then, in the octave window right-click the top window strip and select Edit then Paste. These direction may vary slightly for Mac or Linux computers. |