matlabIntro12011 - Introduction to Matlab, I for MAP 4103,...

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

View Full Document Right Arrow Icon
Introduction to Matlab, I for MAP 4103, Mathematical Modelling I, Spring 2011 Xin Li Department of Mathematics University of Central Florida Matlab is a high level programming language widely used in all areas of applications where scientific computing plays a role. It is highly interactive and user friendly. In this part of Introduction, we pick up some fundamentals of Matlab that will allow us to use Matlab as an advanced calculator. Here’s a record of some Matlab commands we will try in class. I’d like to encourage you to repeat them when you on your own and explore more of Matlab from here. >> diary lecture1.txt >> 22-44 ans = -22 >> ans+55 ans = 33 >> a=22-44 a = -22 >> b=a+3 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
b = -19 >> pi ans = 3.1416 >> format long >> pi ans = 3.141592653589793 >> format short >> u=[1 2 3 4 5 3 2 1] u = 1 2 3 4 5 3 2 1 >> v=[2 4 2] ??? Error using ==> vertcat CAT arguments dimensions are not consistent. >> v=[1;3;4;5] v = 1 3 4 5 2
Background image of page 2
>> v=[1 2 3 4 ] v = 1 2 3 4 >> u u = 1 2 3 4 5 3 2 1 >> u’ ans = 1 2 3 4 5 3 2 1 >> M=[2 3 11 444 6; 4 55 3 2 1; 5 4 3 2 1] M = 2 3 11 444 6 3
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 55 3 2 1 5 4 3 2 1 >> M’ ans = 2 4 5 3 55 4 11 3 3 444 2 2 6 1 1 >> zeros(3) ans = 0 0 0 0 0 0 0 0 0 >> zeros(3,5) ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> eye(3) ans = 1 0 0 0 1 0 0 0 1 >> ones(3,4) 4
Background image of page 4
ans = 1 1 1 1 1 1 1 1 1 1 1 1 >> i=1:100 i = Columns 1 through 12 1 2 3 4 5 6 7 8 9 10 11 12 Columns 13 through 24 13 14 15 16 17 18 19 20 21 22 23 24 Columns 25 through 36 25 26 27 28 29 30 31 32 33 34 35 36 Columns 37 through 48 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 60 49 50 51 52 53 54 55 56 57 58 59 60 Columns 61 through 72 61 62 63 64 65 66 67 68 69 70 71 72 Columns 73 through 84 73 74 75 76 77 78 79 80 81 82 83 84 5
Background image of page 5

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

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

Page1 / 14

matlabIntro12011 - Introduction to Matlab, I for MAP 4103,...

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

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