Error using pentropy function

조회 수: 1 (최근 30일)
Neel Soni
Neel Soni 2020년 4월 15일
댓글: Srivardhan Gadila 2020년 4월 20일
Hello,
I am getting the error as follows when using the pentropy function:
Code: pentropyTest_A = cellfun(@(x)pentropy(x,fs)',XTrain,'UniformOutput',false);
Error: Expected X to be a vector.
Description of XTrain: It is a cell array of 211 x 1. Each cell is a signal containing 6 columns (Voltage and current of 3 phases) and 2000 rows.
I am referring to the ECG classification using LSTM in MATLAB documentation. Please see link:
Thanks.

채택된 답변

Srivardhan Gadila
Srivardhan Gadila 2020년 4월 19일
In the example Classify ECG Signals Using Long Short-Term Memory Networks the training data XTrain is a 8876x1 cell array with each cell having a 1x9000 vector of double data type.
The input argument x for the function pentropy expects a vector and in your case each cell of XTrain is a matrix of dimension 2000x6, which is causing the error.
  댓글 수: 2
Neel Soni
Neel Soni 2020년 4월 20일
Hi thanks for the response. Can you please guide me how to solve the error?
Srivardhan Gadila
Srivardhan Gadila 2020년 4월 20일
@Neel Soni, since each cell of your XTrain is a martix of size 2000x6, how would you like to compute the pentropy? Is it like across rows or columns? i.e., 1x6 vectors(2000 value for each cell) or on 2000x1 vectors(6 values for each cell) or are you thinking of something else?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by