Friday, March 29, 2024

Getting Started With Matlab

Must read

After installation Matlab in your desktop platform double click on the Matlab shortcut icon or Select the start -> Programs -> MATLAB R2014a-> MATLAB R2014a.

  • After opening matlab on the windows platform click on the file, such as .mat, .mdl, and .fig files.
  • Each time you double-click a MATLAB file in Windows Explorer, it starts a new instance of MATLAB

STARTING MATLAB FOR DIFFERENT FILES OR M TYPE FILES

For starting a Matlab file on windows environment include the following steps.

To change the file association for M-files,

  1. In Windows Explorer, select Tools -> Folder Options.
  2. In the resulting Folder Options dialog box, select the File Types tab.
  3. Under Registered file types, select the extension M for MATLAB M-file.
  4. Under Details for ‘M’ extension, click Advanced.
  5. In the resulting Edit File Type dialog box, click Edit.
  6. In the resulting Editing action for type: ‘MATLAB M-file’ dialog box, supply the path to your MATLAB executable, matlab.exe, in the Application used to perform action field, as shown below. Click Browse to look for and select the full path to matlab.exe. Here, $matlabroot represents the root directory for MATLAB–enter the full path for your installation. $matlabroot\matlab\bin\win64\matlab.exe
  7. If you also want to open the selected M-file in the Editor/Debugger in MATLAB, you need to add this flag after the path to matlab.exe:
    -r "edit "%1"

So the entire statement is,

$matlabroot\matlab\bin\win64\matlab.exe -r "edit "%1""

8. Click OK in the Editing action for type: ‘MATLAB M-file’ dialog box. Click OK in the Edit File Type dialog box. Then click Close in the Folder Options dialog box.

On UNIX platforms, start MATLAB by typing matlab at the operating system prompt.

RUNNING THE SCRIPT ON THE MATLAB

After starting a M file with an extension .m in the current directory or clicking change directory into different path, it create a file finish.m. Which contain a debug option which used to show errors in the file, after that it as a run command for executing the file.

QUITTING THE MATLAB SESSION

To end your MATLAB session

  • By selecting/clicking (X) right side corner of the window.
  • select File -> Exit MATLAB in the desktop
  • Or type quit/exit in the Command Window
  • You can run a script file named finish.m each time MATLAB quits that, for example, executes functions to save the workspace, or displays a quit confirmation dialog box.

EXPLANATION OF WINDOWS IN MATLAB

There are 7 types of windows are available in matlab:

Command window

It is a main window in matlab which is used to run, open program and enter variable.

  • A user can enter interactive commands at the command prompt (>>) in the command window.
  • A user can place a series of commands into a script file, and the entire file can be executed by typing its name in the command window.
  • MATLAB script files are also known as M-files, because they have a file extension of “.m”.
- Advertisement -

More articles

- Advertisement -

Latest article