MATLAB includes a special function named end, it’s very useful for creating array subscripts.End function when used in place of an array (row
vector, column vector and matrix) subscript always returns maximum value
that a subscript can have in accordance with size of respective array.
?It should be clear here that
end function returns the maximum value that a subscript can have, not the maximum value/entity that an array (row vector, column vector and matrix)
contains.
E.g
Difference between maximum entity and maximum value. |
When
we will use the end function for the above mentioned array as
last-value=Array(end), here end will return, as stated above, the maximum value
that is 5 it will neither return 15 nor 0.5 because those are entities which
that specific array contains but the maximum value which that subscript can
hold is 5.Other examples using MATLAB are:
To download MATLAB code shown above click here.
How to use end function in MATLAB. |
0 comments:
Post a Comment