<< Chapter < Page Chapter >> Page >
  • Trial>> indicates that the Command Window is in normal mode and the MATLAB license will expire after the trial period ends.
  • EDU>> indicates that the Command Window is in normal mode, in MATLAB Student Version.
  • >> indicates that the Command Window is in normal mode.

The Command Window.
The Command Window.

Command history

The Command History is a log of the commands we have executed in the command window.

The Command History.
The Command History.

Workspace

The workspace consists of a set of variables stored in memory during a MATLAB session. To open the Workspace browser, select Desktop>Workspace in the MATLAB desktop, or type

>>workspace

at the Command Window prompt.

Workspace
Workspace.

Current folder

The Current Folder is like the Finder in Mac OS X or Windows Explorer in Windows operating systems and allows us to browse through the files and folders. The Current Folder also displays details about files in your current directory and within the hierarchy of the folders it contains.

Current Folder
Current Folder.

CurrentFolder1
Current Folder docked on the desktop.

Tool strip

The tool strip contains global tabs, Home, Plots and Apps. Contextual tabs become available when you need them.

tabs
Tabs.

The plots tab allows us to plot various types of graphs quickly and easily.

Plot
The plots tab.

The apps tab gives quick access to interactive applications within MATLAB environment.

Apps
The apps tab.

Layout button allows us to change the desktop layout or go back to the default configuration.

Desktop Layout
Layout button.

Toolbar

The MATLAB toolbar provides on-screen buttons to access frequently used features such as, copy, paste, undo and redo.

Tool Bar
Toolbar.

Keyboard shortcuts

MATLAB provides keyboard shortcuts for viewing a history of commands and listing contextual help.

  1. The up arrow key,
  2. The tab key,
  3. The semicolon symbol.

The up arrow key

Suppose we want to enter the following equation:

>>y=sin(45)

But we mistakenly entered

>>y=sine(45)

MATLAB returns the following prompt:

??? Undefined function or method 'sine' for input arguments of type 'double'.

Instead of retyping the equation, press the up arrow key, the mistakenly entered line is displayed. Using the left arrow key, move the cursor to the misspelled letter. Make the correction and press Return or Enter to execute the command.

Pressing the up arrow key repeatedly recalls the previously entered commands. Likewise, typing the first characters of previously entered line and pressing the up arrow key displays the full command line. To execute that line, simply press the Return or Enter key.

The tab key

Suppose you forgot how to enter the square root command. Begin typing y=sq in the command prompt:

>>y=sq

Then press the tab key and scroll down to sqrt . Select it and press Return or Enter key.

>>y=sqrt

The semicolon symbol

The semicolon symbol at the end of a line suppresses the screen output. This is useful when you want to keep your command window clean.

Type the following entry and press the Return key:

>>y=2+2

The following output is displayed:

y = 4

Now, press the up arrow key to recall our initial entry

>>y=2+2

And insert a semicolon as follows:

>>y=2+2;

No numerical result is displayed however MATLAB stores the value of y in the memory. We can recall the value y by simply typing y and pressing Return.

Matlab help

MATLAB comes with three forms of online help: help, doc and demos.

Help

Typing help in the Command Window lists all primary help topics. You can display a topic by clicking on the link.

>>help

Help
Help.

Or if you know the command or function you need help with, you can type help followed by the command or function. For example to learn about clc command, type help clc at the command prompt:

>>help clc

Help CLC
The output of >>help clc command.

Also try the following command: >>help clear

Help Clear
The output of >>help clear command.

To learn about sine function, type help sin at the command prompt:

>>help sin

Doc

Obviously, to use help effectively, you need to know what you are looking for. Often times, especially when you first start learning an application, it is usually difficult to ask the right questions. In the case of MATLAB, doc command is generally better than help . If you type doc in the command prompt, MATLAB opens a browser from where you can obtain help easier:

>>doc

Doc
Built-in MATLAB Documentation.

Like using help sin , try typing doc sin in the command prompt:

>>doc sin

Demos

You can learn more about MATLAB through demos by typing demo in the command prompt, a list of links to demos will open in Help Browser. Demos and online seminars are available at product demos and online seminars .

>>demo

Demo
Built-in MATLAB Demos.

Useful commands and functions

For a detailed explanation and examples for each of the following type ‘help function’ (without quotes) at the MATLAB prompt.

Useful commands and functions
Command/Function Meaning
clc Clear Command Window
clear Remove items from workspace
who, whos List variables in workspace
workspace Display Workspace browser
cd Change working directory
pwd Display current directory
computer Identify information about computer on which MATLAB is running
ver Display version information for MathWorks products
quit Terminate MATLAB
exit Terminate MATLAB (same as quit)

Summary of key points

  1. MATLAB is a popular technical computing application and MathWorks offers a trial version of MATLAB on their website,
  2. The MATLAB Desktop consists of Command Window, Command History, Workspace, Current Folder and Start Button,
  3. The up/down arrow keys, the tab key and the semicolon are convenient tools to use the Command Window,
  4. MATLAB features an online help, doc and demo,
  5. Various commands and functions make MATLAB experience easier, for example, clc, clear and exit .

Questions & Answers

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A brief introduction to engineering computation with matlab. OpenStax CNX. Nov 17, 2015 Download for free at http://legacy.cnx.org/content/col11371/1.11
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A brief introduction to engineering computation with matlab' conversation and receive update notifications?

Ask