>> clear all >> n=10^5;x=zeros(n,1); >> n=10^9;x=zeros(n,1); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. >> A=[2i 3 5; 7 -11i 13; 17 19 23] A = 0 + 2.0000i 3.0000 5.0000 7.0000 0 -11.0000i 13.0000 17.0000 19.0000 23.0000 >> A(1), A(3) ans = 0 + 2.0000i ans = 17 >> A(2,3) ans = 13 >> A' ans = 0 - 2.0000i 7.0000 17.0000 3.0000 0 +11.0000i 19.0000 5.0000 13.0000 23.0000 >> A(1:3,1) ans = 0 + 2.0000i 7.0000 17.0000 >> A(:,1) ans = 0 + 2.0000i 7.0000 17.0000 >> x=[ 1;2;3] x = 1 2 3 >> y=[1 2 3] y = 1 2 3 >> y' ans = 1 2 3 >> pi*x ans = 3.1416 6.2832 9.4248 >> y=y' y = 1 2 3 >> x'*y ans = 14 >> x,y,x'*y x = 1 2 3 y = 1 2 3 ans = 14 >> x = [1;1;1] x = 1 1 1 >>b=Ax ??? Undefined function or variable 'Ax'. >> b = A*x b = 8.0000 + 2.0000i 20.0000 -11.0000i 59.0000 >> for i=1:n >> c=c+x(i)*y(i); >> end ??? Undefined function or variable 'c'. >> c=0; >> for i=1:n >> c=c+x(i)*y(i); >> end ??? Index exceeds matrix dimensions. >> n=3; >> c=0; >> for i=1:n >> c=c+x(i)*y(i); >> end >> sizeof(x) ??? Undefined function or variable 'sizeof'. >> size(x) ans = 3 1 >> help max MAX Largest component. For vectors, MAX(X) is the largest element in X. For matrices, MAX(X) is a row vector containing the maximum element from each column. For N-D arrays, MAX(X) operates along the first non-singleton dimension. [Y,I] = MAX(X) returns the indices of the maximum values in vector I. If the values along the first non-singleton dimension contain more than one maximal element, the index of the first one is returned. MAX(X,Y) returns an array the same size as X and Y with the largest elements taken from X or Y. Either one can be a scalar. [Y,I] = MAX(X,[],DIM) operates along the dimension DIM. When complex, the magnitude MAX(ABS(X)) is used, and the angle ANGLE(X) is ignored. NaN's are ignored when computing the maximum. Example: If X = [2 8 4 then max(X,[],1) is [7 8 9], 7 3 9] max(X,[],2) is [8 and max(X,5) is [5 8 5 9], 7 5 9]. See also MIN, MEDIAN, MEAN, SORT. >> exit