필터 지우기
필터 지우기

How to solve "Transpose on ND array is not defined. Use PERMUTE instead."

조회 수: 3 (최근 30일)
Dingbang Liang
Dingbang Liang 2018년 5월 22일
댓글: Dingbang Liang 2018년 5월 22일
lena = double(imread('lena.tif'));
figure(6);
imshow(lena)
y_LenaHalf = double(imread('lena_half.tif'));
figure(7);
imshow(y_LenaHalf)
x2 = 1:256;
xi_2 = 1:(255/511):256;
yi_2 = interp1(x2, y_LenaHalf, xi_2);
yi2_2 = interp1(x2, yi_2.', xi_2).';
figure(8);
imshow(uint8(yi2_2))
SE2 = (lena - yi2_2).^2;
MSE2 = mean(mean(SE2));
I want to enlarge photo 'lena' using interp1, but i got an issue.
Error using .' Transpose on ND array is not defined. Use PERMUTE instead.
Error in week9_lectorial (line 44) yi2_2 = interp1(x2, yi_2.', xi_2).';

답변 (1개)

KSSV
KSSV 2018년 5월 22일
A = rand(2,3,3) ;
A' % throws error
So, you cannot transpose a 3D matrix, striaght away. Check this:
[m,n,p] = size(A) ;
iwant = zeros(n,m,p) ;
for i = 1:p
iwant(:,:,i) = A(:,:,i)' ;
end

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by