Home

Common MATLAB Commands

|
Updated:  
2016-03-26 08:32:30
|
From The Book:  
MATLAB For Dummies
Explore Book
Buy On Amazon

The following table contains a listing of commands that you use relatively often in MATLAB. You won't find every command listed — that would require a book in itself. However, these commands are usually used several times each session.

Command Purpose
cla Clears the current plot
clc Clears the Command window
clear variable name> Removes a specific variable from the Workspace window (as specified by variable name>)
clear all Removes all of the variables from the Workspace window
close figure name> Closes a specific figure (as specified by figure name>)
close all Closes all of the current figures
diary filename> Specifies the name of the file to use for the Diary feature
diary off Stops saving the Command window text to a file
diary on Starts saving the Command window text to a file
exist keyword> Checks whether a keyword or file is in use
format compact Removes extraneous spaces from the Command window
gca Obtains a handle to the current axes
gcf Obtains a handle to the current figure
gco Obtains a handle to the current object
get(handle>, property>) Obtains the property> found in the object pointed at by handle>
help command or file> Displays help documentation for the command> or comments in files you've created
iskeyword Displays a list of all the MATLAB keywords
iskeyword name> Determines whether name> is a keyword
load filename> Loads the file containing variables to the Workspace window
more off Displays output using standard scrolling so that all of the output appears at one time
more on Tells MATLAB to display output one screen at a time
save filename> Saves the variables shown in the Workspace window to the specified file
set(handle>, property>, value>) Sets the property> found in the object pointed at by handle> to the specified value>

About This Article

This article is from the book: 

About the book author:

Jim Sizemore is Professor of Physics and Engineering at Tyler Junior College. For over 25 years he s worked in the semiconductor and software industries as a process engineer, device physicist, and software developer and has been teaching college physics, engineering, and math for the last 13 years.

John Paul Mueller is a freelance author and technical editor. He has writing in his blood, having produced 100 books and more than 600 articles to date. The topics range from networking to home security and from database management to heads-down programming. John has provided technical services to both Data Based Advisor and Coast Compute magazines.