Hi everyone,
I'm using PCA to reduce the dimensions of my data and it was working without any problems, then when I came the next day and ran the MATLAB the PCA started throwing errors. I tried the exact example from MATLAB documentation (including using the same data in the example) but same error. below is my code followed by the error:
load hald
coeff = pca(ingredients)
the error:
Error using pcaklm (line 73)
Unknown type specified
Error in pca (line 53)
[w,truefrac] = pcaklm(mfilename,varargin{:});
------------------------------------------------------------------------------------------------------
My MATLAB version is R2021b
My OS is Ubuntu LTS 20.04

 채택된 답변

the cyclist
the cyclist 2023년 7월 22일

1 개 추천

The line
[w,truefrac] = pcaklm(mfilename,varargin{:});
is not in the MATLAB pca function. You have presumably started calling a different pca function.
Try calling
which pca -all
from the command line to see what functions are in your path.
An internet search on pcaklm suggests that you might inadvertently be calling the ECGdeli Toolbox version. Perhaps you installed that?

댓글 수: 3

Qudor Engineer
Qudor Engineer 2023년 7월 25일
편집: Qudor Engineer 2023년 7월 25일
Thanks for reply.
Yes I insttaled ECGKit one year ago and the pca was working properly then suddenly it stop working and when I run
which pca -all
the output is:
/home/Documents/MATLAB/ecg-kit-0.1.6/common/prtools/pca.m
/home/Documents/MATLAB/ecg-kit-0.1.6/common/prtools/@prdataset/pca.p % prdataset method
/home/Documents/MATLAB/ecg-kit-0.1.6/common/prtools/@prdataset/pca.m % prdataset method
/usr/local/MATLAB/R2021b/toolbox/stats/bigdata/@tall/pca.m % tall method
/usr/local/MATLAB/R2021b/toolbox/stats/gpu/@gpuArray/pca.m % gpuArray method
/usr/local/MATLAB/R2021b/toolbox/stats/stats/pca.m
I think the easiest solution for you is to use pathtool to move the Stats toolbox version of pca to be higher priority than the ECGdeli version.
I added the path using pathtool and now it is working. thank you very very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2023년 7월 22일

댓글:

2023년 7월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by