Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Dingbang Liang
Dingbang Liang le 22 Mai 2018
Commenté : Dingbang Liang le 22 Mai 2018
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).';

Réponses (1)

KSSV
KSSV le 22 Mai 2018
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

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by