why eye(3)'s and eye(3)'s row,coloumn number are equal ?

조회 수: 2 (최근 30일)
Oguzhan Gurbuz
Oguzhan Gurbuz 2017년 7월 10일
답변: Sebastian Castro 2017년 7월 10일
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.

답변 (1개)

Sebastian Castro
Sebastian Castro 2017년 7월 10일
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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by