Matlab

551 mots 3 pages
Matlab

. . . ... 233 144 89 55 34 21 13 8 5 3 2 1 1 0 : .

. 1 2 4 2 5 10 0 -1 -1

. sin, cos, log, exp, tan, atan, 1/x, 1/log(x), 1/x
3

1

Matlab

. ( ) .

function Exercice_N1() a=input('Please choose a number. a =') if (mod(a,2)==0) sprintf('%d is an odd number.',a) else sprintf('%d is an even number',a) end end

.

1 2

3

function Exercice_N2() clc a = input('Please choose 1st number. a ='); b = input('Please choose 2nd number. b ='); temp=a; a=b; b=temp; sprintf('a = %d',a) sprintf('b = %d',b) end

.

.

2

Matlab

function Exercice_N3V0() a = input('Please choose 1st number. a ='); b = input('Please choose 2nd number. b ='); c = input('Please choose 3rd number. c ='); if (ab & a>c sprintf('%d < %d < %d',b ,c ,a ) end end end end

function Exercice_N3V1() a = input('Please choose 1st number. a ='); b = input('Please choose 2nd number. b ='); c = input('Please choose 3rd number. c ='); if (ab & a>c Show(b ,c ,a ) end end end end function Show(a,b,c) sprintf('%d < %d < %d',a ,b ,c ) end

3

Matlab sort . function Exercice_N3V1() a = input('Please choose 1st number. a ='); b = input('Please choose 2nd number. b ='); c = input('Please choose 3rd number. c ='); Vector =[a,b,c]; Sorted_Vector = sort(Vector); Show(Sorted_Vector(1), Sorted_Vector(2), Sorted_Vector(3)) end

... 233 144 89 55 34 21 13 8 5 3 2 1 1 0 : . ... 0,1,2,3

.

function Exercice_N4() max=input('Please choose the series length: '); Vector = [0:max]; for i=3:max+1 Vector(i) = Vector(i-1) + Vector(i-2); end Vector end

. 1 2 4 2 5 10 0 -1 -1

1 0 0 : 0

0 1 0 : 0

0 0 1 : 0

0 0

1

4

Matlab

function Exercice_N5() A = [1 2 0; 2 5 -1; 4 10 -1] Transpose_A= A' Multiplication_1= A*A' Multiplication_2= A.*A' Inverse_A= inv(A) I=inv(A)*A Eigenvalues_A = eig(A) singular_value_decomposition=svd(A) Characterisitic_polynomial_A = round(poly(A)) eig_original=roots(Characterisitic_polynomial_A)

en relation

  • Sujet de math bts f.e.e
    602 mots | 3 pages
  • Brevet blanc
    965 mots | 4 pages
  • ma bie
    2664 mots | 11 pages
  • Corrigé dm de math
    612 mots | 3 pages
  • Fhdfsgdsg
    621 mots | 3 pages
  • Maths
    993 mots | 4 pages
  • Suce
    296 mots | 2 pages
  • Vanina vanini
    254 mots | 2 pages
  • Corrigé eval bilan 3
    549 mots | 3 pages
  • Corrigé ds ds
    634 mots | 3 pages
  • Foot
    255 mots | 2 pages
  • Ds de math n°3
    543 mots | 3 pages
  • lolitude de ouf
    1484 mots | 6 pages
  • Maths
    1496 mots | 6 pages
  • hymne a quebec
    1299 mots | 6 pages