i got a error in median

2 Ansichten (letzte 30 Tage)
Logeswaran pitchai muthaiyah
Kommentiert: Image Analyst am 15 Dez. 2020
%Train PCA
load Xtest.mat;
%Input data from TE Chemical Process
X=Xtest(1:501,1:2); %2 continuous variable
% find dimension of matrix, n=number of rows, p=number of columns/variables
[n,p] = size(X);
ran = min(size(X,1),size(X,2));
if p>ran
p=ran;
end
c=median(X); %median
C=repmat(c,n,1);
d=std(X); %standard deviation
D=repmat(d,n,1);
X=(X-C)./D;
% diagonalisation
[Tmat,E,L] = svd(X,0);
eigmat = E;
The error showing is
Error using tabular/permute (line 215)
Undefined function 'permute' for input arguments of type 'table'.
Error in median (line 186)
x = permute(x, perm);
  1 Kommentar
Image Analyst
Image Analyst am 15 Dez. 2020
Attach 'Xtest.mat' - you forgot to attach it.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sibi
Sibi am 15 Dez. 2020
Bearbeitet: Sibi am 15 Dez. 2020
X is in table,thats why its not working.
try this .
Xtest=xlsread("Q3Data_TE.xlsx");
X=Xtest(1:501,1:2);
[n,p] = size(X);
ran = min(size(X,1),size(X,2));
if p>ran
p=ran;
end
c=median(X); %median
C=repmat(c,n,1);
d=std(X); %standard deviation
D=repmat(d,n,1);
X=(X-C)./D;
% diagonalisation
[Tmat,E,L] = svd(X,0);
eigmat = E;

Kategorien

Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by