Vous êtes sur la page 1sur 3

[Seleccione la fecha]

1 [Escriba el ttulo del documento]


MATLAB for engineers
Introduction
MATLAB is a mathematical tool that offers an integrated development environment with an own programming
language, among its basic functions this matrix manipulation, the representation of functions and data,
implementation of algorithms, creation of user interfaces and communication with programs in other
languages.
MATLAB has two additional tools that expand their benefits one is SIMULINK (multidomain simulation
platform) and GUIDE (editor of user interfaces - GUI).
Meaning of the acronyms MATLAB
MATLAB = MATrix LABoratory
Developer Mathworks
Created by Prof. Cleve Moler in 1984
M programming language created in 1970
Toolboxes: are comprehensive collections of Matlab functions which exist in the environment of matlab
MATLAB consists of 5 parts
Desktop and development environment tools
Libraries
Matlab language
Graphics
External interfaces
Desktop and development environment tools:
Workspace: Window where the variables are keeping
Command History: Save up to 500 lines
Command Window:
Libraries
Computational algorithm
Function elements


[Seleccione la fecha]
2 [Escriba el ttulo del documento]
Matlab language
High language level array/array with control sentences
Graphics
External interfaces


Basic commands
Types of Variables
Note: In MATLAB is not necessary to initialize variables
> > 1.65 double of 64-bit
> > to 16-bit Char
Variables that we are going to manage within the course are vectors and arrays of double type or char. Also
have other supported types: Complex, Symbolic, integers from 16-bit and 8 bitss, etc.
Name of Variables (63 characters maximum)
first character must be a letter
2nd character can be a combination of letters, numbers, and/or script low
Note: In case of exceeding the limit of characters MATLAB does not take into account the following characters.
There are pre-built variables (built in variables)
i and j complex numbers
PI 3.1415...
ANS result
INF and - inf infinity (+ and -)
NaN Not A Number

Assignment operator (=)

> > x + 4 = 50 ; x = 50 - 4

Recursive allocation
> > x = 344


[Seleccione la fecha]
3 [Escriba el ttulo del documento]
> > x = x + 4
> > x = 1160
Note: When we use semicolon (;) at the end of each statement ignores the assignment.
Multiple assignments
> > x = 2; y = 4; z = x + and
> > z = 8
Commands
Who: enumerates all variables used thus far, it is a command that enables us to know the variables we used to
avoid confusion as well.

> > who
Your variables are:
Ans r s t v x and z

Whos: Command that it gives us information more detailed about the used variables

> > whos
Name Size Byte Class
1 x 1 8 double array
- - - -
- - - -
Save: Command which allows us to store the variables that we want in a file with extension *.mat
> > savemyFile b %% saves the variables a and b in the file myfile.mat

Clear: I command that he allows us to delete one or more variables in the workspace
> > clear to b %% The variables a and b have been deleted from the workspace
> > clear%% All variables have been removed from the workspace

Load: Command which allows us to load variables previously saved within the file with extension *.mat
> > load myfile %% Variables that were guardadadas appear again within the
%% workspace
Save All: Command flutes allows storing all the variables used so far

> > save myenv;% Save xxx save all the variables that have been used
> > clear all;% Clear all clean the workspace
> > load myenv%% Load xxx loads all variables stored in myenv

Vous aimerez peut-être aussi