MATLAB: What’s the n -space- 1 mean here

MATLABmatricesmatrix manipulation

i'm learning about Matlab function now. this is one of the official answers of a course. i know it's very basic. but i'm confuse about it. here is the code..
function v = int_col(n)
v = [n 1:n-1]';
end

Best Answer

If n = 4, then it's saying create a row vector where 4 is the first value and it's followed by 1 to n-1, in other words, followed by [1,2,3]. So the final vector would be [4, 1, 2, 3]. MATLAB style guidelines say that there should be a comma rather than a space, and sometimes (like if you did a Code Analyzer report and the row vector is the output of a function) you'll get an orange squiggle if you don't have it.
Related Question