Matlab final year project in ludhiana
-
Upload
deepikakaler1 -
Category
Education
-
view
84 -
download
0
description
Transcript of Matlab final year project in ludhiana
![Page 1: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/1.jpg)
CONTACT US ON-
Address- Opp. Phagwara Bus Stand,Above Bella Pizza, Handa City Center,Phagwara
[email protected], [email protected]
Web site-www.e2matrix.com
Contact no-07508509730, 09041262727, 7508509709
![Page 2: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/2.jpg)
![Page 3: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/3.jpg)
![Page 4: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/4.jpg)
Command Window
Workspace / Current Directory
Command History
Explore the Matlab Desktop
![Page 5: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/5.jpg)
Matlab prompt
assign operator
suppress command output
comment operator
Try the same line without the semicolon and comments
![Page 6: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/6.jpg)
![Page 7: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/7.jpg)
![Page 8: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/8.jpg)
![Page 9: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/9.jpg)
![Page 10: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/10.jpg)
square brackets to define matrices
semicolon for next row in matrix
![Page 11: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/11.jpg)
A =
3 2 1
5 1 0
2 1 7
indices of matrix element(s)
![Page 12: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/12.jpg)
Try the following >> x=0:pi/12:2*pi;>> y=sin(x)
![Page 13: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/13.jpg)
A =
3 2 1
5 1 0
2 1 7
What’ll happen if you type A(:,:) ?
![Page 14: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/14.jpg)
A =
3 2 1
5 1 0
2 1 7
B =
1 3 1
4 9 5
2 7 2
Create matrices A and B and try out the the matrix operators in this slide
Enter matrix B into the Matlab workspace
![Page 15: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/15.jpg)
Matlab Desktop
Press to create new m-file in the matlab editor
![Page 16: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/16.jpg)
Highlight a few lines of your script by left- clicking and dragging the mouse over the lines. Right-click the highlighted lines and select Evaluate Selection.
Will be slightly different in Linux
![Page 17: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/17.jpg)
![Page 18: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/18.jpg)
outputinputfunction name
for statement block
function keyword
help lines for function
Access the comments of your Matlab functions >> help iterate Make sure you save changes to the
m-file before you call the function!
![Page 19: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/19.jpg)
Functions can have many outputs contained in a matrix
Remember to use the Matlab help command for syntax>> help if
if statement block
![Page 20: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/20.jpg)
Method is linear>>
i =
4
i =
16
i =
256
While statement block Switch statement block
Without ; to print output
![Page 21: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/21.jpg)
Click mouse on the left of the line of code to create a breakpoint
local function workspace
exit debug mode
Debug menus
![Page 22: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/22.jpg)
Investigate the function >> y=A*cos(w*t+phi);for different values of phi (eg: 0, pi/4, pi/3, pi/2), w (eg: 1, 2, 3, 4) and A (eg: 1, 0.5, 2). Use the hold on Matlab command to display your plots in the same figure. Remember to type hold off to go back to normal plotting mode. Try using different plot styles (help plot)
A = amplitudephi = phasew = angular frequency = 2*pi*frequency
Plot style
![Page 23: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/23.jpg)
Next week …
![Page 24: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/24.jpg)
Remember to use the Matlab help command if you get stuck
stringcell
error handling
Operating system command
Graphical user interface
Continue in next line
![Page 25: Matlab final year project in ludhiana](https://reader033.fdocuments.in/reader033/viewer/2022052904/557ccea1d8b42a43438b510e/html5/thumbnails/25.jpg)
Figure 1
Figure 2