Difference between revisions of "Getting started with MATLAB or Python"
Line 89: | Line 89: | ||
====Command Window==== | ====Command Window==== | ||
(1) The command window (or "command line") provides your main means of interacting with the MATLAB software. The command line allows you to enter simple codes that are processed immediately. All program outputs also appear in the command window. While it is technically possible to write an entire program at the command line, this is not recommended. For true programs, scripts and functions will be used. | |||
====Current Directory==== | ====Current Directory==== | ||
The current directory panel lists all of the files (MATLAB or other) that are located in the directory MATLAB is currently accessing. This directory may be changed via the drop down address bar at the top of the main program window. For a program to run properly, ALL CODES required must be in the same directory (for example, if you write a main script file that calls a separate function file, both files must be in the same directory). | |||
====Command History==== | ====Command History==== | ||
The command history | |||
====Workspace==== | ====Workspace==== | ||
====Editor Window==== | ====Editor Window==== | ||
where you can write functions and scripts (to be discussed in detail later) | |||
====Plot Window==== | ====Plot Window==== | ||
Where plots are displayed | |||
[[File:MATLAB_Windows_Labeled.PNG|center|400px]] | [[File:MATLAB_Windows_Labeled.PNG|center|400px]] | ||
Line 128: | Line 132: | ||
=====doc ''function_name''===== | =====doc ''function_name''===== | ||
Brings up information on any built-in MATLAB function | |||
{| style="border: 1px black;" cellpadding="3" | {| style="border: 1px black;" cellpadding="3" | ||
Line 139: | Line 144: | ||
=====edit===== | =====edit===== | ||
Opens the text editor | |||
{| style="border: 1px black;" cellpadding="3" | {| style="border: 1px black;" cellpadding="3" | ||
Line 150: | Line 156: | ||
=====clc===== | =====clc===== | ||
Clears the screen | |||
{| style="border: 1px black;" cellpadding="3" | {| style="border: 1px black;" cellpadding="3" | ||
Line 161: | Line 168: | ||
=====clear===== | =====clear===== | ||
Clears the variables from the workspace (and from memory) | |||
{| style="border: 1px black;" cellpadding="3" | {| style="border: 1px black;" cellpadding="3" | ||
Line 172: | Line 180: | ||
=====Built in Functions===== | =====Built in Functions===== | ||
Commonly used built in MATLAB functions (most of these are self-explanatory) | |||
[[File:MATLAB_Common_Functions.PNG|center|400px]] | [[File:MATLAB_Common_Functions.PNG|center|400px]] | ||
Line 177: | Line 186: | ||
=====Built in Constants===== | =====Built in Constants===== | ||
Prede�ned constants include | |||
[[File:MATLAB_constants.PNG|center|400px]] | [[File:MATLAB_constants.PNG|center|400px]] | ||
Line 182: | Line 192: | ||
=====fprintf() and disp()===== | =====fprintf() and disp()===== | ||
To display output on the screen use disp() or for more organized display use fprintf() | |||
[[File:MATLAB_fprintf.PNG|center|400px]] | [[File:MATLAB_fprintf.PNG|center|400px]] | ||
Line 187: | Line 198: | ||
=====Semicolon===== | =====Semicolon===== | ||
Placing a semicolon at the end of a line of code will suppress any output produced by that line | |||
[[File:MATLAB_semi_colon.PNG|center|400px]] | [[File:MATLAB_semi_colon.PNG|center|400px]] |
Revision as of 11:17, 10 September 2010
Introduction
|
|
Access / Installation
|
|
Getting Started
|
|
Introduction to the Command Line
|
|
Scripts and Functions
|
|
Code Structures
|
|
Plotting Data
|
|
Additional Resources
|
|