This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/programming/code/vectorsize.m

6 lines
246 B
Matlab

a = [2 4 6 8 10]; % row vector with five elements
s = size(a) % store the return value of size() in a new variable
s(2) % get the second element of s,
% i.e. the length along the 2nd dimension
size(a, 2) % the shortcut