How to transform an array into a bottom triangle
이전 댓글 표시
Dear Matlab community,
I have an array by the size of 11175 x 1 elements. These values come from a bottom triangle, which was created from a 149 x 149 matrix. My problem is I would like to get the vector of the last row and all the columns (so (149,:)) of the original matrix. If I could somehow transform this 11175 element array into the original matrix, I could get the values I want, but I'm having trouble as to how to do such a transformation. Any help would be greatly appreciated.
Thank you,
Paul
댓글 수: 2
dpb
2019년 6월 22일
Depends on how the vector was created -- what's the storage order? Is it the normal ML column-major?
Prabhjot Dhami
2019년 6월 22일
채택된 답변
추가 답변 (1개)
Walter Roberson
2019년 6월 22일
0 개 추천
squareform() ?
댓글 수: 2
Prabhjot Dhami
2019년 6월 22일
dpb
2019년 6월 22일
squareform is specific to pdist function in that it returns a 0 diagonal as well. No way I can see to not return that. But, you could simply acknowledge it being there and use
S=squareform(V);
R=S(end,1:end-1);
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!