ustcrliu

三,Mathematics

1. create matrices

magic(4), pascal(3), zeros(3,2), ones(5,5), randi(10,3,2) ...

[ ] putting vectors(rows, columns) together by using [ ]

2. matrices operations

A + B, A * B, A .* B, 

A\' and A.\' are both transpose, for A containing complex numbers (a+bi), you have to also transpose complex numbers (a-bi) if A\', while A.\' does not.

Identity Matrix eye(m, n)

inv(A)

det(A)

cond(A)

norm(v, n), norm(A, n)

 

 

五,Programming

a = randi(100, 1)

if rem(a, 2) == 0

  disp("even")

elseif a < 80

  disp ...

else

  disp ...

end

 

switch daystring

  case \'monday\'

    disp ...

  case \'tuesday\'

    disp ...

  otherwise

    disp ...

end

 

yournumber = input("enter a number:")

 

A == B returns where aij == bij, is a matrix too. 

if isequal(A, B) returns a logical number 1 or 0

isempty

all

any

 

for n = 3 : 32

  rn = rank(magic(n))

end

 

while

continue

break

 

分类:

技术点:

相关文章:

  • 2021-11-30
  • 2022-01-08
  • 2022-01-08
  • 2021-11-29
  • 2021-11-29
  • 2022-12-23
  • 2021-06-09
猜你喜欢
  • 2021-11-20
  • 2021-12-19
  • 2022-01-08
  • 2021-12-10
  • 2021-12-19
  • 2021-11-27
相关资源
相似解决方案