How To Open Matlab Command Window
Running Functions and Entering Variables
Entering Statements at the Command Line Prompt
The prompt (>>) in the Command Window indicates that MATLAB is prepare to accept input from yous. When you see the >> prompt, y'all can enter a variable or run a function. This prompt and your input are known every bit the command line.
For case, to create A, a 3-by-iii matrix, blazon
-
A = [1 two 3; 4 5 6; 7 8 10]
When you lot press the Enter or Return primal after typing the line, MATLAB responds with
-
A = 1 2 3 4 5 6 7 8 10
To run a part, type the function including all arguments and printing Return or Enter. MATLAB displays the result. For example, type
-
magic(2)
and MATLAB returns
-
ans = 1 three 4 ii
If you want to enter multiple lines before running, use Shift+Enter or Shift+Return later each line until the final. Then press Enter or Render to run all of the lines.
The K>> prompt in the Control Window indicates that MATLAB is in debug mode. For more than data, see Editing and Debugging 1000-Files.
Evaluating a Selection
To run a choice in the Command Window, brand the option, and and so correct-click and select Evaluate Choice from the context menu. Alternatively, later making a selection, press Enter or Render. You lot cannot evaluate a selection while MATLAB is decorated, for example, running an M-file.
Opening a Pick
You lot tin open a function, file, variable, or Simulink model from the Control Window. Select the name in the Command Window, and and then right-click and select Open Selection from the context window. This runs the open function for the item yous selected then that it opens in the appropriate tool:
- M-files and other text files open in the Editor
- Figure files (
.fig) open up in a figure window - Variables open in the Array Editor
- Models open in Simulink
See open for details. If no file exists to work with the selected detail, Open option calls edit.
Hyperlinks to Run Functions
Utilize matlab: to create a hyperlink for specified text, which runs the specified part when clicked. For example, typing
-
disp('<a href="matlab:magic(4)">Generate magic square</a>')
displays
When the user clicks the link "Generate magic square", MATLAB runs magic(4). You tin use the disp or the fprintf functions with this feature.
Running Ane Process
In MATLAB, you can only run i process at a time. If MATLAB is busy running one function, any commands you lot issue will be buffered in a queue. The adjacent command volition run when the previous one finishes.
| | Opening the Command Window | Controlling Input and Output | |
Source: http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/matlab_env/command3.html
Posted by: mcbridefarretionly.blogspot.com

0 Response to "How To Open Matlab Command Window"
Post a Comment