Download
matlab n.
Skip this Video
Loading SlideShow in 5 Seconds..
Matlab PowerPoint Presentation

Matlab

384 Views Download Presentation
Download Presentation

Matlab

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Matlab Early Introduction

  2. Outline • Download • Installation • Simple guide • Loop • Condition • Solve • Plot • Animation

  3. Download

  4. Download

  5. Download

  6. Download

  7. Download Download point 1 Installation guide pdf

  8. Installation

  9. Installation

  10. Installation

  11. Installation CD KEY 2013a: 05181-58047-50065-55129-39119-05118-39891-26395-09346-10758-43576-63951-11422-27452-30255-09479

  12. Installation

  13. Installation

  14. Installation

  15. Simple guide(command window) • >> 1+3/2 %simple guide ans = 2.5000 • >> 1+3/2+2*2; • >> x=3*3 x = 9

  16. Simple guide(matrix&vector) >> s = [1 3 5 2]; % The number is separated by “space”. >> t = 2*s+1 t = 3 7 11 5 ************************************************************ >> A = [1 2 3 4; 5 6 7 8; 9 10 11 12]; % build a3×4 matrixA >> A % Show the content of A A = 1 2 3 4 5 6 7 8 9 10 11 12

  17. Simple guide(matrix&vector) >> AT=A‘ % AT is transporse of A AT = 1 5 9 2 6 10 3 7 11 4 8 12

  18. Simple guide(mfile)

  19. Simple guide(mfile)

  20. Simple guide(path of mfile) • >> addpath('D:\personal objects\HW\college\Matlab');

  21. Loop • While Loop:

  22. Loop • For Loop

  23. Condition • If

  24. Solve(linear) >>syms x; >>solve(x^4 + 1 == 2*x^2 - 1)ans = (1 + i)^(1/2) (1 - i)^(1/2) -(1 + i)^(1/2) -(1 - i)^(1/2)

  25. Plot clear all; t=0:0.01:3; h=0.01; i=1; while t(i)<3 y(i)=t(i)^2-2*t(i)+1; i=i+1; end y(i)=t(i)^2-2*t(i)+1; plot(t,y); hold on; % Hold the plot plot(t,cos(t),'red');

  26. Plot(axis) • axis([xmin, xmax, ymin, ymax]); • For example:>>axis([-2,2 ,-2,2]);

  27. Plot(label) clear all; t=0:0.01:3; h=0.01; i=1; while t(i)<3 y(i)=t(i)^2-2*t(i)+1; i=i+1; end y(i)=t(i)^2-2*t(i)+1; plot(t,y); hold on; % Hold the plot plot(t,cos(t),'red'); xlabel('X'); ylabel('Y');

  28. Animation t=0:0.01:10; x=0:0.01:5; h=0.01; j=1; while t(j)<10 i=1; while x(i)<5 y(i)=x(i)*sin(5*x(i)-5*t(j)); i=i+1; end y(i)=x(i)*sin(5*x(i)-5*t(j)); plot(x,y); axis([0,5,-5,5]); M(j)=getframe j=j+1; end

  29. Animation i=1; while x(i)<5 y(i)=x(i)*sin(5*x(i)-5*t(j)); i=i+1; end y(i)=x(i)*sin(5*x(i)-5*t(j)); plot(x,y); M(:,length(t))=getframe; movie(M,3) %play the animation movie2avi(M,'exampleformovie.avi','compression','None');