1 / 22

Introduction to Matlab

Introduction to Matlab. By. Dr. Adil S. Balghonaim. Mat lab. Matrix. Laboratory. The program is capable of doing matrix algebra on all type of matrix. Create new folder and rename it. Short cut for Matlab. You also can start matlab from desktop as follows. Start. All Programs. Matlab.

Download Presentation

Introduction to Matlab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Matlab By Dr. Adil S. Balghonaim

  2. Matlab Matrix Laboratory The program is capable of doing matrix algebra on all type of matrix

  3. Create new folder and rename it Short cut for Matlab

  4. You also can start matlab from desktop as follows Start All Programs Matlab

  5. Command line

  6. Start programming >> a=3 a = 3 >>

  7. Semicolon “ ; ” at the end of a statement will not print the value in the screen >> b=4 ; >> However the variable “ b “ with the value 4 is still there and can be used >> b b = 4 >>

  8. >> c=a+b c = 7 >> sqrt(c) ans = 2.6458 >> If you did not specify a variable for the result it will store it at “ ans”

  9. You also can make a program and execute the sequence of commands File M-File

  10. File name File type is *.m

  11. Directory were Matlab access You either move you’re the M-file you just Created (p1.m ) to that directory OR Change the current directory to were the file reside In that case change it to the EE 207 –Matlab folder In the desktop

  12. EE 207 –Matlab folder in the desktop

  13. Click here to Change the directory

  14. Now you are at the same directory were the file And matlab can be excuted

  15. >> p1 will execute the file p1.m Line by line Result c = 7

  16. Vectors >> a=[1 2 3] a = 1 2 3

  17. Complex Numbers >>a=3+(j*4) a = 3.0000 + 4.000 i >>angle(a) ans = 0.9273 >>abs(a) ans = 5 radian

  18. >>angle(a) ans = 0.9273 radian >> angle(a)*180/pi ans = 53.1301 degree

  19. >>b=12+(4*i) b = 12.0000+4.000i >> a+b ans = 15.0000 + 8.0000 i

More Related