How to cut and reshape values?
이전 댓글 표시
out =
Columns 1 through 5
90 90 -45 0 0
90 90 -45 0 0
90 90 -45 0 0
90 90 -45 0 45
90 90 0 0 45
90 -45 0 0 45
Columns 6 through 9
45 45 0 -45
45 45 -45 0
45 0 -45 45
45 0 -45 0
45 0 -45 -45
45 0 -45 90
i want to reshape it into layer
layer = reshape(layer',size(layer,2),1,size(layer,1))
but i'm getting vertical...but i need horizontal
& I want only last 5 layer Means
layer(:,:,1) = [90 90 -45 0 0 45 45 -45 0];
layer(:,:,2) = [90 90 -45 0 0 45 0 -45 45] and so on....
채택된 답변
추가 답변 (1개)
Walter Roberson
2016년 1월 26일
layer = permute(out, [2 3 1])
댓글 수: 3
Triveni
2016년 1월 26일
Walter Roberson
2016년 1월 26일
layer = permute(out(end-4:end,:), [2 3 1])
Triveni
2016년 1월 26일
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!