Why is my GUI program producing an error when I 'Run' it?

1 visualización (últimos 30 días)
SampleEntropyのコードです。太字の部分、SampleEntropyが定義されていない、とエラーが出ます。どのように対処すればよいでしょうか?
%% SAMPLE ENTROPY
COP=COP';
%% Downsampling to 100 Hz (if Fs>100); see explanation in data analysis section of main paper
if Fs>100
Ratio = Fs/100;
COP_resample=resample(COP,1,Ratio);
else
COP_resample = COP;
end
%% Calculation of sample entropy of the anterior-posterior (y) and mediolateral (x) COP time series.
% Defining SEn parameters
m=3;
r=0.01;
%Calculating estimates and errors (latter are not used)
N_COP_x = (COP_resample(:,1)-(mean(COP_resample(:,1))))/var(COP_resample(:,1));
N_COP_y = (COP_resample(:,2)-(mean(COP_resample(:,2))))/var(COP_resample(:,2));
[SEN_x,err_x]=sampleEntropy(N_COP_x,m,r);
[SEN_y,err_y]=sampleEntropy(N_COP_y,m,r);
% SEn_total = SEN_total(length(SEN_total),1);
SEn_x = SEN_x(length(SEN_x),1);
SEn_y = SEN_y(length(SEN_y),1);

Respuesta aceptada

Kojiro Saito
Kojiro Saito el 7 de Mzo. de 2023
sampleEntropyという関数がMATLABの検索パスに入っていないためです。
sampleEntropy.mファイルがあるフォルダーをaddpathで検索パスに追加すれば実行できるようになると思います。
  9 comentarios
Kojiro Saito
Kojiro Saito el 9 de Mzo. de 2023
コメントで記載したコードではaddpathはフォルダー名を指定しています。ファイル名ではなくフォルダー名を引数に入れるので
addpath('C:\Users\megan\OneDrive\デスクトップ\914\データ\1yama\cop\SampEn')
が正しいです。
康二 中西
康二 中西 el 9 de Mzo. de 2023
ありがとうございました。
無事結果が出ました。
丁寧にご返答頂き大変助かりました。

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 線形代数 en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!