Hi everyone,
im trying to build a [n X n] matrix from a [1 n*n] vector. can anybody give me a simple code?

 채택된 답변

Mischa Kim
Mischa Kim 2014년 3월 8일
편집: Mischa Kim 2014년 3월 8일

0 개 추천

Hossein, use reshape:
A = 1:4*4;
n = sqrt(length(A)); % if A is indeed an n*n vector
B = reshape(A,n,n)

추가 답변 (0개)

카테고리

질문:

2014년 3월 8일

댓글:

2014년 3월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by