why eye(3)'s and eye(3)'s row,coloumn number are equal ?
2 views (last 30 days)
Show older comments
why are eye(3,3)'s and eye(3)'s row,coloumn numbers equal ? or rand(3) and rand(3,3). I wonder is it about matlab skill or computer's working principle.
0 Comments
Answers (1)
Sebastian Castro
on 10 Jul 2017
This is intended behavior. If you enter one argument, it will automatically build a square matrix.
If you're looking to do a row or column vector, then use the following syntax:
>> columnVec = zeros(3,1);
>> rowVec = zeros(1,3);
Sebastian
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!