How to convert a column vector into an image
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello sir
I have an vector of size (258x1). Now I want to convert it into a square matrix (101x101) i.e. in 2D image in matlab.
Please help me.
댓글 수: 7
채택된 답변
Walter Roberson
2019년 5월 23일
nrow = 6; ncol = 6;
B = full( sparse(C(:,1), C(:,2), A, nrow, ncol) );
Or
nrow = 6; ncol = 6;
B = accumarray(C, A(:), [nrow ncol]);
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!