Reputation: 11
I am very new to MATLAB and I was wondering if anyone can suggest how to construct a Nx1 column vector with all the entries being 0, except for the last entry which is 1. I tried playing with the following commands with no luck
A=zeros(N,1)
B=ones(N,1)
C=horzcat(A,B)
Cvector=C(:)
Upvotes: 0
Views: 84