Académique Documents
Professionnel Documents
Culture Documents
Emanuele Ruffaldi
Copyright 2009,Emanuele Ruffaldi. This work is licensed under the Creative Commons Attribution-ShareAlike
License.
COURSE OVERVIEW
Objectives
• Website: http://percro.sssup.it/~pit/courses/simulink/
Java
Toolboxes Blocksets
M Engine Simulink
History
Matrix
• Matrices are the fundamental type of data in MATLAB
– Dense or Sparse
– Different element types (usually double)
• Which is the meaning of Matrix Data?
– Linear Algebra Matrix
– Mapping
– Image
– Representation of Graphs
• Operators: + * / ^
• Transposition: „
• Element operators: .* .+
• Most of the functions accept matrices and vectors
– Operations on matrices are by columns
See also Matrix Cookbook http://matrixcookbook.com/
• M-file language
– Dynamically Typed
– Scripted language
• Syntax:
– no {} as in C
– more similar to Pascal style
– if .. else .. elseif … end
– for .. end
– while .. end
– boolean operators: && ||
– bit operators: & |
Loop vs Indexed Operations
• Workspaces
– assignin(workspace,name,value)
– evalin(workspace,expression)
• Global to Functions
– global
• Persistent to Functions (C static)
– persistent name
Publishing Results
mygui = gui.autogui;
num = gui.slider(„Points:‟,[5 50]);
txt = gui.textmenu(„Color‟,{„r‟,‟b‟});
while mygui.waitForInput()
plot (num.Value,txt.Value)
end
Major Toolboxes
• File Exchange
– http://www.mathworks.com/matlabcentral/fileexchange/
• MATLAB/Simulink Books (SSSA)