MATLAB

60 flashcards · Other · by Minh Đức

  1. when you dont want to show the result on the screen, what do you do?

    put a semicolon at the end

  2. in matlab, what is the beginning index of an array

    1

  3. if we want to multiply, divide, exponential 2 array that have same sizde, what should we do

    .* ./ .^

  4. funtion for vector's geonometric length

    norm (v)

  5. number of element in a vector

    length(v)

  6. how to select column 1 and 3 of matrix v

    v(:, [1,3])

  7. length() của 1 matrix thì return cái j

    số ptử lớn nhất của row hoặc column

  8. cách tạo 1 vector bắt đầu từ a, kết thúc tại b, step là n

    a:n:b

  9. cách tạo 1 vector bắt đầu từ a, kết thúc tại b, số phần tử là n

    linspace(a,b,n)

  10. sort matrix v theo column

    sort (v)

  11. sort matrix v theo row

    sort(v,2)

  12. funtion for ex

    exp(x)

  13. phương trình cho arc tan(x)

    atan(x)

  14. equation for ln(x) and log(x)

    log(x) and log10(x)

  15. how to find roots

    write coefficient in a vector a then roots(a)

  16. which search path MATLAB use on your computer

    path where MATLAB is installed

  17. hàm max() của 1 vector return cái j

    the biggest number in that vector

  18. funtion max() of a matrix return what?

    the row contain the largest number of each column

  19. what does it mean find(x)

    return all the indexs that have elements rather than 0

  20. [a b c] = find(a)

    a: row indices of the non zero element of a b: column indices of the non-zero element of a c : no-0 element of a

  21. meaning of [x k] = max(a) if a is a vector

    store the max value of a in x store the index of x in k

  22. meaning of sum (a)

    return a row vector contain the sum of each column

  23. size (w) return what

    [m n] where m is row of a matrix n is column of matrix

  24. in default, what is the direction of traversal in matlab

    through column

  25. if in a matrix have a complex number, what happend

    max(), min(), sum() will treat each element as absolute magnitude

  26. if A and B are 2 matrix A .* B = A * B' = A * B =

    element by element dot( A. B) cross(A,B)

  27. when we can use matrix multiplication ( cross product)

    when column of this matrix is equal to the row of that matrix

  28. when you want to write sin cos tan for angle that is in radius

    sind, cosd, tand

  29. cách viết a:n:b theo linspace (a,b,n)

    a:(b-a)/(n-1):b

  30. write linspace as a:n:b

    linspace(a,b, (b-a)/n + 1)

  31. write a function to find the maximum element in each row of matrix A

    max(A') '

  32. cách tạo 1 matrix D có 3 dimension với matrix A,B,C là các layer của nó

    D = cat(3,A,B,C)

  33. how to find the largest number in each layer of 3-D matrix D

    max(D) and it will return the max number of each layer

  34. how to find the largest number in the whole 3-D matrix D

    max(max(D))

  35. muốn tính cho từng segment ta dùng

    .*

  36. muốn tính total của các segment ta dùng

    dot(a,b)

  37. cách giải 1 phương trình 3 ẩn trở lên

    vector A store all the coefficient , 1 equation is 1 row vector B store all the right-hand side result in the same row with A ans = A \ B

  38. when multiply element by element an vector with an matrix, the vector have to

    vector need to have same row or same column with matrix

  39. bài cho tìm L,r để cost min, mà không cho biết L,R

    cho L = 0, tính R xong viết vector chứa R viết vector chứa L viết công thức cost tìm min

  40. M = (F *r) . n

    dot( cross(F,r), n)

  41. form for anonymous function

    fhandle = @(arglist) expr

  42. how to plot a function

    fplot(@y, [ range ])

  43. cách giải 1 pt f(x) = 0 trong matlab

    ta viết pt, sau đó dùng fzero để tìm x

  44. cách để tìm max 1 function y = f(x) và x tương ứng

    đầu tiên t cần tính được y sau đó dùng [y0 index] = max(y) x = x(index)

  45. if rank(a) = rank([a b]) = number of unknown rank(a) != rank([a b]) rank(a) = rank([a b]) != number of unknown

    unique solution ( use \ ) there is no solution infinite solution ( use rref)

  46. khi nào thì dùng pinv

    underdetermined system

  47. what is a consistent system, an inconsistent system

    consistent system: has a solution inconsistent : has no solution

  48. các bước để bân bằng hóa học bằng matlab

    cân bằng từng nguyên tố cho hệ số nguyên tố cuối = 1 a\b ans = ans/(x1)

  49. when there is infinite solution use what

    rref or pinv

  50. when there is uniquie solution use

    inv or \

  51. how to solve a linear problem with constraint

    use simlp

  52. what simlp will return and how to write it

    the minimum of a funciton simlp(f,a,b)

  53. how to find A and B in simlp function

    Ax <= B

  54. how to find max of function of f(x)

    g(x) = -f(x) max = fminbnd(g,x1,x2)

  55. cách chia dư a cho btrong matlab

    mod(a,b)

  56. cách để nhập input là số vào matlab

    x = input('prompt')

  57. cách để nhập input là string vào matlab

    x = input('prompt' , 's')

  58. how to preallocate array A of N number in matlab

    A = zeros(n)

  59. how to preallocate a char array of n characters

    a = blanks(n)

  60. how to preallocate array A when dont know the numbers of elements

    A = []