An interactive introduction to MATLAB
1.4variables and arrays 11 Read MATLAB error messages! ??? Error using ==> mtimes Inner matrix dimensions must agree. This er ...
12 basic concepts Comments: On Line 7 thesizecommand returns the number of rows and columns in the matrix. On Lines 11, 15 and ...
1.5solving systems of linear equations 13 1.5 Solving systems of linear equations Solving systems of linear equations is one of ...
14 basic concepts Listing 1.13: Solving a system of linear equations 1 >> A = [5−3 2;−3 8 4; 2 4−9]; 2 >> B = [10; 2 ...
1.5solving systems of linear equations 15 Exercise 2: Variables and arrays Create the variables to represent the following matr ...
16 basic concepts Exercise 2: Variables and arrays (continued) continued b) 5x+3y−z= 10 3x+2y+z= 4 4x−y+3z= 12 c) x 1 −2x 2 −x ...
1.5solving systems of linear equations 17 Exercise 2: Variables and arrays (continued) Geometric series The sum of a geometric ...
...
2 plotting MATLABis very powerful for producing both 2dand 3dplots. Plots can be created and manipulated interactively or by com ...
20 plotting Figure 3: Plot off(x) =e−^10 xsin(x) xlabel('My x−axis label'),ylabel('My y−axis label'), andtitle('My title') can ...
2.1simple 2d plotting 21 Table 4: Colours in plots string specifier line colour r Red g Green b Blue (default) w White k Black P ...
22 plotting MATLABhas many built-in plot types, and a great way of getting a quick overview of all the different plot types is t ...
2.1simple 2d plotting 23 Importing data from external sources You can import data from other programs intoMATLABusing the Copy → ...
24 plotting Exercise 3: Simple 2 d plotting Please save all the plots you produce using the File → Save option in the Figure Win ...
2.2curve-fitting 25 2.2 Curve-fitting MATLABprovides a number of powerful options for fitting curves and adding trend-lines to d ...
26 plotting ï (^1000102030405060708090100) ï 50 0 50 100 150 200 250 300 350 xïdata yï data Basic curveïfitting Original data Li ...
2.33d plotting using plot3 and surf 27 ï 1 ï0.5 0 0.5 1 ï 1 ï0.5 0 0.5 1 0 5 10 15 20 25 30 35 x 3D helix y z Figure 8: Usingplo ...
28 plotting (1,7) (2,7) (3,7) (4,7) (1,6) (2,6) (3,6) (4,6) (1,5) (2,5) (3,5) (4,5) Figure 9: Operation ofmeshgridfunction Comme ...
2.33d plotting using plot3 and surf 29 ï0.4 ï0.3 ï0.2 ï0.1 0 0.1 0.2 0.3 0.4 ï 1 ï0.5 0 0.5 1 ï 1 ï0.5 0 0.5 1 ï0.5 0 0.5 x f(x, ...
30 plotting Exercise 4: 3 d plotting Plot the following 3dcurves using theplot3function: a) Spherical helix x=sin ( t 2c ) cos ...
«
1
2
3
4
5
6
»
Free download pdf