error using tranpose (recieving permute error )
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Meetul Choudhary
il 26 Lug 2023
Modificato: Meetul Choudhary
il 28 Lug 2023
CODE:
%% Testing Phase
load('testFeatures');
featvales=b2{1};
label=b2{2};
num_dims = max(size(featvales));
X=featvales';
Y=label';
PROBLEM:
I have to calculate the average for 2 different dimension
1st for 10 dimensional function
2nd for 30 dimensional function
ERROR :(the following error is recieved while executing the code)
Error using '
Transpose on ND array is not defined. Use PERMUTE instead.
Error in FeatureSelection (line 28)
X=featvales';
2 Commenti
Walter Roberson
il 26 Lug 2023
num_dims = max(size(featvales));
That is incorrect.
num_dims = ndims(featvales);
Risposta accettata
Fangjun Jiang
il 26 Lug 2023
The error message is clear. How do you transpose a three (or more) dimension array?
a=rand(2,3);
a';
a=rand(2,3,4);
a';
7 Commenti
Più risposte (1)
James Tursa
il 26 Lug 2023
Modificato: James Tursa
il 26 Lug 2023
If you are trying to transpose the initial 2D pages of your variable, you can do this:
pagetranspose(featvales)
Or this:
d = 1:ndims(featvales)
permute(featvales,[2,1,d(3:end)])
But it isn't clear if this will fix your underlying problem.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!