Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is a Classroom License for instructional use only.
- Research and commercial use is prohibited.
- >> a=2
- a =
- 2
- >> a=2;
- >> b=4;
- >> a+b;
- >> c=a+b;
- >> A=[1,2,3]
- A =
- 1 2 3
- >> At
- Undefined function or variable 'At'.
- >> A^
- A^
- ↑
- Error: Expression or statement is incomplete or incorrect.
- >> A*
- A*
- ↑
- Error: Expression or statement is incomplete or incorrect.
- >> A*A*
- A*A*
- ↑
- Error: Expression or statement is incomplete or incorrect.
- >> A*A'
- ans =
- 14
- >> A(1)
- ans =
- 1
- >> A(4)
- Index exceeds matrix dimensions.
- >> A= 1:5:100
- A =
- Columns 1 through 16
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76
- Columns 17 through 20
- 81 86 91 96
- >> max(A)
- ans =
- 96
- >> 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 X is complex, the maximum is computed using the magnitude
- max(ABS(X)). In the case of equal magnitude elements, then the phase
- angle max(ANGLE(X)) is used.
- max(..., NANFLAG) specifies how NaN (Not-A-Number) values are treated.
- NANFLAG can be:
- 'omitnan' - Ignores all NaN values and returns the maximum of the
- non-NaN elements. If all elements are NaN, then the
- first one is returned.
- 'includenan' - Returns NaN if there is any NaN value. The index points
- to the first NaN element.
- Default is 'omitnan'.
- Example: If X = [2 8 4; 7 3 9] then
- max(X,[],1) is [7 8 9],
- max(X,[],2) is [8; 9] and
- max(X,5) is [5 8 5; 7 5 9].
- See also min, cummax, median, mean, sort.
- Reference page for max
- Other functions named max
- >> [maxim, idx] = max(A)
- maxim =
- 96
- idx =
- 20
- >> B=[1,2,3;4,5,6]
- B =
- 1 2 3
- 4 5 6
- >> B(1,2)
- ans =
- 2
- >> B(2,2)
- ans =
- 5
- >> A(2:3)
- ans =
- 6 11
- >> A
- A =
- Columns 1 through 19
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91
- Column 20
- 96
- >> A = [A;A;A;A]
- A =
- Columns 1 through 19
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91
- 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91
- Column 20
- 96
- 96
- 96
- 96
- >> plot(1:5:10,1:5:10)
- >> plot(1:5:10,1:5:10, 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, 'r', 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, 'r-', 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, '-r', 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, 'r--', 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, 'r---', 'LineWidth', 2)
- Error using plot
- Error in color/linetype argument.
- >> plot(1:5:10,1:5:10, 'r*', 'LineWidth', 2)
- >> plot(1:5:10,1:5:10, 'r-*', 'LineWidth', 2)
- >> legend(test)
- Undefined function or variable 'test'.
- >> legend('test')
- >> plot(1:5:10,1:5:10, 'r-*', 'LineWidth', 2)
- >> grid on
- >> hold on
- >> plot(1:5:10,1:5:10, 'r-*', 'LineWidth', 2)
- >> grid on
- >> plot(1:5:10,1:5:10, 'r-*', 'LineWidth', 2)
- >> legend('test')
- >> legend('test2')
- >> legend('test2', 'test')
- Warning: Ignoring extra legend entries.
- > In legend>set_children_and_strings (line 629)
- In legend>make_legend (line 321)
- In legend (line 247)
- >> legend('test2')
- >> figure()
- >> bar(1:5:10, 1:8:10)
- >> bar(1:5:10, 1:8:10, 'r--')
- Error using matlab.graphics.chart.primitive.Bar/set
- There is no Marker property on the Bar class.
- Error in matlab.graphics.chart.internal.ctorHelper (line 6)
- set(obj, pvpairs{:});
- Error in matlab.graphics.chart.primitive.Bar
- Error in bar (line 186)
- h(i) = matlab.graphics.chart.primitive.Bar('Parent',hPar,...
- >> bar(1:5:10, 1:8:10, 'r')
- >> grid on
- >> xlabel('time')
- >> ylabel('t')
- >>
- >> title('tytuł')
- >> x=0:1:100
- x =
- Columns 1 through 19
- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
- Columns 20 through 38
- 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
- Columns 39 through 57
- 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
- Columns 58 through 76
- 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
- Columns 77 through 95
- 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
- Columns 96 through 101
- 95 96 97 98 99 100
- >> y=2*x+1;
- >> plot(x,y)
- >> grid on
- >> y=x.*x+2
- y =
- Columns 1 through 9
- 2 3 6 11 18 27 38 51 66
- Columns 10 through 18
- 83 102 123 146 171 198 227 258 291
- Columns 19 through 27
- 326 363 402 443 486 531 578 627 678
- Columns 28 through 36
- 731 786 843 902 963 1026 1091 1158 1227
- Columns 37 through 45
- 1298 1371 1446 1523 1602 1683 1766 1851 1938
- Columns 46 through 54
- 2027 2118 2211 2306 2403 2502 2603 2706 2811
- Columns 55 through 63
- 2918 3027 3138 3251 3366 3483 3602 3723 3846
- Columns 64 through 72
- 3971 4098 4227 4358 4491 4626 4763 4902 5043
- Columns 73 through 81
- 5186 5331 5478 5627 5778 5931 6086 6243 6402
- Columns 82 through 90
- 6563 6726 6891 7058 7227 7398 7571 7746 7923
- Columns 91 through 99
- 8102 8283 8466 8651 8838 9027 9218 9411 9606
- Columns 100 through 101
- 9803 10002
- >> plot(x,y)
- >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement