Вы находитесь на странице: 1из 6

This is a Classroom License for instructional use only. Research and commercial use is prohibited.

To get started, select "MATLAB Help" from the Help menu. >> cd d:\gego >> v=[1,2,4,0,-1] v = 1 2 4 0 -1

>> v1=[1;2;4;0;-1] v1 = 1 2 4 0 -1 >> vs=k:l:veg ??? Undefined function or variable 'k'. >> k=3,l=-4;veg=-11.2 k = 3 veg = -1.120000000000000e+001 >> l=-4 l = -4 >> vs=k:l::veg ??? vs=k:l::veg | Error: Missing operator, comma, or semicolon. >> vs=k:l:veg vs = 3 -1 -5 -9

>> A=round(10*round(5,4))-7 ??? Error using ==> round Incorrect number of inputs. >> A=rand(10*rand(5,4))-7 ??? Error using ==> rand Size vector must be a row vector with integer elements.

>> A=round(10*rand(5,4))-7 A = -6 -3 1 -7 -6 -5 -5 -1 -4 -5 -7 0 -3 2 -2 -3 1 -2 -5 0

>> Ra=A(2:4,3:4) Ra = 0 -3 2 1 -2 -5

>> Rap=A([2,1,4],[2,1]) Rap = -5 -5 -4 -3 -6 -7

>> A([2,5],:)=A([5,3],:) A = -6 -6 1 -7 1 -5 -5 -1 -4 -1 -7 -2 -3 2 -3 -3 0 -2 -5 -2

>> A([3,5],:)=A([5,3],:) A = -6 -6 1 -7 1 >> ------------------------------------------------------------------------------program futtatsa: >> norma ??? Undefined function or variable 'n'. Error in ==> d:\gego\norma.m On line 3 ==> for i=1:n >> n=15 -5 -5 -1 -4 -1 -7 -2 -3 2 -3 -3 0 -2 -5 -2

n = 15 >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 5 ==> vn2=vn2+v(i)^2; >> v=round(10*rand((n,1)))-8 ??? v=round(10*rand((n,1)))-8 | Error: ")" expected, "," found. >> v=round(10*rand((n,1))-8 ??? v=round(10*rand((n,1))-8 | Error: ")" expected, "," found. >> v=round(10*rand((n,1)))-8 ??? v=round(10*rand((n,1)))-8 | Error: ")" expected, "," found. >> v=round(10*rand(n,1))-8 v = 0 -8 -1 -4 0 -3 -1 -4 -5 -6 -6 -1 -5 -3 -6 >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 5 ==> vn2=vn2+v(i)^2; >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 5 ==> vn2=vn2+v(i)^2; >> norma ??? Undefined function or variable 'vn2'.

Error in ==> d:\gego\norma.m On line 6 ==> vn2=vn2+v(i)^2; >> nomra ??? Undefined function or variable 'nomra'. >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 6 ==> vn2=vn2+v(i)^2; >> help sqrt SQRT Square root. SQRT(X) is the square root of the elements of X. Complex results are produced if X is not positive. See also SQRTM. Overloaded methods help sym/sqrt.m >> help ^ Operators and special characters. Arithmetic operators. plus - Plus + uplus - Unary plus + minus - Minus uminus - Unary minus mtimes - Matrix multiply * times - Array multiply .* mpower - Matrix power ^ power - Array power .^ mldivide - Backslash or left matrix divide \ mrdivide - Slash or right matrix divide / ldivide - Left array divide .\ rdivide - Right array divide ./ kron - Kronecker tensor product kron Relational operators. eq - Equal ne - Not equal lt - Less than gt - Greater than le - Less than or equal ge - Greater than or equal == ~= < > <= >=

Logical operators. and - Logical AND & or - Logical OR | not - Logical NOT ~ xor - Logical EXCLUSIVE OR any - True if any element of vector is nonzero all - True if all elements of vector are nonzero Special characters.

colon paren paren paren punct punct punct punct punct punct punct punct punct punct punct transpose ctranspose horzcat vertcat subsasgn subsref subsindex

Colon : Parentheses and subscripting ( ) Brackets [ ] Braces and subscripting { } Function handle creation @ Decimal point . Structure field access . Parent directory .. Continuation ... Separator , Semicolon ; Comment % Invoke operating system command ! Assignment = Quote ' Transpose .' Complex conjugate transpose ' Horizontal concatenation [,] Vertical concatenation [;] Subscripted assignment ( ),{ },. Subscripted reference ( ),{ },. Subscript index

Bitwise operators. bitand - Bit-wise AND. bitcmp - Complement bits. bitor - Bit-wise OR. bitmax - Maximum floating point integer. bitxor - Bit-wise XOR. bitset - Set bit. bitget - Get bit. bitshift - Bit-wise shift. Set operators. union unique intersect setdiff setxor ismember Set union. Set unique. Set intersection. Set difference. Set exclusive-or. True for set member.

See also ARITH, RELOP, SLASH, FUNCTION_HANDLE. >> help sqr sqr.m not found. >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 6 ==> vn2=vn2+v(i)^2; >> norma ??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 6 ==> vn2=vn2+v(i)^2; >> norma

??? Undefined function or variable 'vn2'. Error in ==> d:\gego\norma.m On line 6 ==> vn2=vn2+v(i)^2; >> norma vn1 = 53 vn2 = 1.658312395177700e+001 vnv = 8 >> norm(v,2) ans = 1.658312395177700e+001 >> norm(v) %ugyanaz mint a norm(v,2) ans = 1.658312395177700e+001 >> norm(v,1) ans = 53 >> norm(v,inf) ans = 8 >> norm(v,'fro') %frovenius norma ans = 1.658312395177700e+001 >>

Вам также может понравиться