Sideway
output.to from Sideway
Draft for Information Only

Content

  MatLab: Getting Started
   MatLab as a Scratch Pad
   Common Useful Commands
   Help Documentation
   Workspace Manipulation
   Useful Commands

MatLab: Getting Started

Major Reference Source: MatLab Verson 7.0

One way to start with MatLab is to use MatLab as a calculator. Commands are typed in the Command Window after the MatLab prompt, >>. Commands are then evaluated after pressing the Enter key.

MatLab as a Scratch Pad

Since MatLab provides an immediate computing capability for immediate evaluation, the Command Window can be used as a powerful multiple display scientific graphing calculator by entering MatLab commands at the prompt command, >>, using the PC keyboard.  Entered command will be displayed in the Command Window while evaluation results can be displayed in the Command Window or can be made use of the Figure Window to visualize the evaluation results graphically.

Common Useful Commands

 As entering interactive commands in the Command Window is one of the important feature of MatLab, some common useful commands should be known beforehand to using MatLab interactively.

Help Documentation

One important type of commands can be entered in the Command Window is calling functions by entering keywords at the Command Window. MatLab provides a MatLab help documentation set which can be accessed through the Help Browser by clicking on the help browser icon or by typing command in the Command Window.  Helps on standard MatLab keywords or topics can also be found in the help documentation set. Command examples:

  • doc: to open and display the first page of the online documentation in the Help Browser.

  • helpdesk: to open and display the first page of the online documentation in the Help Browser.

  • helpwin:  to open and display the "List of Help Topics" page of the online documentation in the Help Browser.

  • helpwin TOPIC:  to open and display the help page for the named TOPIC in the Help Browser.

  • helpbrowser: to bring up the Help Browser

  • help: to open and display the "List of Help Topics"  page of the online documentation in the Command Window.

  • help TOPIC: to open and display the help page for the named TOPIC in the Command Window.

  • lookfor STRING: to lookfor or search the first comment line of topic help pages for the keyword STRING and display the matched comment lines in the Command Window.

Workspace Manipulation

Another important type of commands can be entered in the Command Window is creating variables by typing statements at the Command Window. MatLab provides a Workspae window for display or exporing variables available in the working space and an Array Editor for exploring or editing each individual variable in the working space. Besides, variable can also be manuipulated by typing statements and commands at the Command Window.  Command examples:

  • who: to list the variable names available in the current workspace

  • whos: to list all available variables with information, e.g. name, size, bytes, etc., in the current workspace

  • VARIABLENAME: to display the value of the variable or array specified by the name of variable, VARIABLENAME.

  •  clear: to clear or remove all variables from the workspace.

  • ans: to store the most recent result evaluated by MatLab when the statement of expression is not assigned to anything. ans is the name of automatically created variable where ans stands for answer.

  • save: to save all workspace variables to the binary "MAT-file" named "matlab.mat" in the current directory

  • save FILENAME: to save all workspace variables to the binary "MAT-file" specified by the name FILENAME  in the current directory

  • load:  to load all workspace variables from the binary "MAT-file" named "matlab.mat"  in the current directory

  • load  FILENAME:  to load workspace variables from the binary "MAT-file" specified by the name FILENAME in the current directory

Useful Commands

  • Running MatLab demos

    • demo: to open the first page of the list of available demos on the Demo tab in the Help Browser

  • Clearing Windows,

    • clc: to clear the contents of the Command Window

    • clf to clear the contents of the Figure Window

  • Stopping running scripts

    • Ctrl-C: to abort or stop a runnng script, where Ctrl-C means hold down the Control and C keys simultaneously.
  • Logging sessions

    • diary: to toggle the diary state of the logfile system. When diary state is ON, MatLab copys all subsequent Command Window input and most of the Command Window result output and then appends to the file, named 'diary', if no file name is speciifed.

    • diary OFF: to suspends the logging process.

    • diary ON: to turn on the logging process.

  • Manipulating command history
    • UPARROW: to recall previous commands by moving one single command line backward along the Command History where UPARROW is the "UPARROW" key.

    • DOWNARROW: to recall previous commands by moving one single command line forward along the Command History where DOWNARROW is the "DOWNARROW" key.

    • CHARS UPARROW: to recall previous commands with first few characters of the command equal to the specified CHARS by moving backward along the Command History.

    • CHARS DOWNARROW: to recall previous commands with first few characters of the command equal to the specified CHARS by moving forward along the Command History.

  • Manipulating working directory

    • cd: to return and display the current working directory.working directory.

    • cd ..: to change the current working directory by moving the directory to the one abouve the current one.

    • cd PATH:  to set the current working directory to the one specified by the PATH.

    • dir: to list the current MatLab working directory

  • Manipulating path

    •  path: to display the current MatLab search path.

    • matlabpath: to display the current MatLab search path.

  • Running System Commands

    • ! SYSTEMCOMMAND: to pass the specified SYSTEMCOMMAND prefixing by an exclamation point, !,  from MatLab to the underlying Operating System.


©sideway

ID: 140400001 Last Updated: 4/1/2014 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019