フィルターのクリア

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
  1 件のコメント
Dingbang Liang
Dingbang Liang 2018 年 5 月 22 日
Then how can I solve my issure straight away in my code?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by