Matlab_tutorial

Matlab_tutorial - Chemical Engineering 541 Computer Aided...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chemical Engineering 541 Computer Aided Design Methods Matlab Tutorial
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Overview Matlab is a programming language suited to numerical analysis and problems involving vectors and matricies. Matlab = Mat rix Lab oratory Many built in functions for solution of linear systems, interpolation, integration, solution of ODEs, etc. Straightforward syntax No need for external compilation/linking Built in 2D, 3D graphics, very flexible Can interface with C++, Java, Fortran Object oriented programming capabilities Graphical interface. Built-in debugging capability. Great for rapid programming/prototyping. Excellent learning environment, ideas carry over to faster, more flexible (and complex) languages, such as C, Fortran.
Background image of page 2
3 FreeMat, Octave, Scilab Freemat, Octave, and SciLab are open source, Matlab-like variants Octave contains fewer features, but very similar syntax, and runs most Matlab scripts without modification. Visualization is via gnuplot Scilab has a Matlab-like look and feel. Freemat has a nice interface, and good plotting capabilities. www.gnu.org/software/octave , www.scilab.org , http://freemat.sourceforge.net
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Environment Command Window Editor Window History Variables
Background image of page 4
5 Matlab Search Path File >> set path Organize files into one or more place as you create them. This goes for other environments/languages as well. Search path: EDU>> myvar 1. variable? 2. built-in function? 3. script file in current directory? 4. Matlab path? 5. Error
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Defining Variables, Expressions Expressions are saved to ans Variables are case sensitive: no spaces, start with a letter. Semicolon supresses output to screen Variables defined, use who, whos Special Vars: ans, beep, pi, eps, inf, NaN, i, j, nargin, nargout, realmin, realmax, bitmax, varargin, varargout Reserved Words for end if while function return elseif case otherwise switch continue else try catch global persistent break Operators: + - * / \ ^ Comments: EDU>> a=b+c; % this is a comment
Background image of page 6
7 Vectors and Matricies Vectors, Matricies, Arrays are synonymous Enter elements between [ . .. ] column elements separated by “,” or “ “ rows separated by “;” transpose with single quote. elements can be expressions
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/20/2012 for the course CHE 633 taught by Professor Davido.lignel during the Winter '12 term at BYU.

Page1 / 25

Matlab_tutorial - Chemical Engineering 541 Computer Aided...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online