Row major order matrix

조회 수: 8 (최근 30일)
Basem Sharafeldin
Basem Sharafeldin 2015년 10월 15일
편집: Andrei Bobrov 2015년 10월 16일
Im trying to create a 11x11 matrix in column matrix order using numbers 1-121 but i cannot figure out how to do it. I'm trying to use the ones and zeros command and transpose and similar functions.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2015년 10월 15일
편집: Andrei Bobrov 2015년 10월 16일
out = bsxfun(@plus,1:11:111,(0:10)')
or
out = reshape(1:121,11,[]);
or
out = zeros(11);
out(:) = 1:121;
  댓글 수: 1
Basem Sharafeldin
Basem Sharafeldin 2015년 10월 15일
편집: Basem Sharafeldin 2015년 10월 15일
is there a way to do this using matrix commands such as transpose, zeros(), ones(), or other in that category?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by