Error using .' Transpose on ND array is not defined. Use PERMUTE instead.

3 ビュー (過去 30 日間)
Paola Perrone
Paola Perrone 2018 年 4 月 22 日
コメント済み: Aman Swaraj 2020 年 2 月 11 日
I have this code but it give to me this error, how I can fix it?
% Pass CNN image features to trained classifier
predictedLabels = predict(classifier, testFeatures); _this is the code I want to compile_
[X,varargin] = orientX(X,expectedObsInRows,varargin)
% Copyright 2015 The MathWorks, Inc.
[obsIn,~,varargin] = ...
internal.stats.parseArgs({'observationsin'},{'rows'},varargin{:});
obsIn = validatestring(obsIn,{'rows' 'columns'},...
'classreg.learning.internal.orientX','ObservationsIn');
obsInRows = strcmp(obsIn,'rows');
if expectedObsInRows~=obsInRows
X = X.'; _at this line I have the error mentioned_
end
end
Thank you so much

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 4 月 22 日
Your testFeatures needs to be 2D, not 3D.
Be careful if you are working with images: RGB images are 3D.
  3 件のコメント
Muhammad Umer Farooq
Muhammad Umer Farooq 2018 年 8 月 4 日
I also receive same error. I check my X is 4D. How i will know which row-columns i need to rearrange using premute?
Aman Swaraj
Aman Swaraj 2020 年 2 月 11 日
did you get the solution to this problem @Paola Perrone?

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

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by