building a square matrix out of a vector
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi everyone,
im trying to build a [n X n] matrix from a [1 n*n] vector. can anybody give me a simple code?
댓글 수: 0
채택된 답변
Mischa Kim
2014년 3월 8일
편집: Mischa Kim
2014년 3월 8일
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!