1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
   | 
 
               a = [1,2,3;4,5,6;7,8,9];              b = 1:1:10;           b = 1:10;                             c = linspace(0,10,5);                      e = eye(4);               z = zeros(1,4);               o = ones(4,1);               r = rand(4);               rn = randn(4);                          
 
      diag_a = diag(a,1);       tril_a = tril(a,1);                a*a                       a.*a              pinv(a)                [v,D] = eig(a);                det(a)              rank(a)              compan(b)         
 
               chg_a = a;         chg_a(2,3) = 4;           chg_a(1,:) = [2,2,2];           chg_a(:,1) = [];                T_a = a';              c1_a = cat(1,a,a);           c2_a = cat(2,a,a);                rs_a = reshape(a,1,9);  
 
 
               [row_a, col_a] = size(a);                len_a = length(a);         
 
                            mul_1(:,:,1) = [1,2,3;2,3,4];             mul_1(:,:,2) = [3,4,5;4,5,6];                      mul_2 = [1,2,3;2,3,4];             mul_2(:,:,2) = [3,4,5;4,5,6];                        mul_31 = [1,2,3;2,3,4];             mul_32 = [3,4,5;4,5,6];             mul_3 = cat(3,mul_31,mul_32);  
 
 
               str0 = 'hello world';           str1 = 'I''m a student';           str3 = ['I''m' 'a' 'student'];           str4 = strcat(str0, str1);           str5 = strvcat(str0, str1);           str6 = double(str0);           str7 = char(str6);                             strcmp(str0, str1);               strncmp(str0, str1, 3);               strcmpi(str0, str1);               strncmpi(str0, str1, 3);                        strfind(str0, str1);               strmatch(str1, str0);               strtok(str0);               strrep(str0, str1, str2);                        upper(str0);               strjust(str0, 'right');               strtrim(str0);               eval(str0);               
 
           str_b = num2str(b);          abs_str = abs('aAaA');  
  第4部分:多项式
 
 
               p = [1, 2, 3, 4];           f1 = poly2str(p, 'x');           f2 = poly2sym(p);                x = 4;         y1 = polyval(p, x);                r = roots(p);          p0 = poly(r);           
 
                        X = [-3, -1, 0, 1, 3];         Y = [9, 1, 0, 1, 9];           y2 = interp1(X, Y, 2);           y2m = interp1(X, Y, 2, 'spline');                         
  X = [2, 3, 9, 15, 6, 7, 4]; A = [1, 7, 2; 9, 5, 3; 8, 4 ,6]; B = [1, 7, 3; 9, 5, 3; 8, 4 ,6];
               y = max(X);           [y, k] = max(X);           [y, k] = max(A, [], 2);                y = mean(X);           y = median(X);           y = mean(A, 2);           y = median(A, 2);                Y = sort(A, 1, 'ascend');           [Y, I] = sort(A, 1, 'ascend');                y = sum(X);           y = prod(X);           y = cumsum(X);           y = cumprod(X);           
 
                        x = fminsearch(fun, x0);              x = fzero(fun, x0);  
 
  |