Use the special end
keyword:
lastelement = myvector(end);
solved Returning the last element of a vector with an unknown length [closed]
Use the special end
keyword:
lastelement = myvector(end);
solved Returning the last element of a vector with an unknown length [closed]