Dot indexing is not supported for variables of this type

조회 수: 2 (최근 30일)
Nassim CHERIF
Nassim CHERIF 2022년 4월 6일
댓글: Image Analyst 2022년 4월 7일
hello, i have this feature Extraction algorithm but i have error : Dot indexing is not supported for variables of this type
xApp = av_train;
data=xApp (: , 1);
type = 1;
feature=featureExtraction(data,'mean',type);
there is my feature Extraction function, can anyone help me please
function feature=featureExtraction(data,param,type)
%
%Input:
% data:nxm, n:#of patterns, m: number of features
% method:'raw','mean','meanVar'
% window: window length
% type: 1 --- for movtimavg
% 2 --- for windowingLabels
switch param.method
case 'raw', feature = data;
case 'mean'
if (type==1)
feature = movtimavg(data,param.window,param.step);
end
if (type==2)
feature = windowingLabels(data,param.window,param.step);
end
case 'meanVar',feature = movtimavg(data,param.window,param.step,1);
if (type==1)
feature = movtimavg(data,param.window,param.step,1);
end
if (type==2)
feature = windowingLabels(data,param.window,param.step);
end
end

채택된 답변

Scott MacKenzie
Scott MacKenzie 2022년 4월 6일
편집: Scott MacKenzie 2022년 4월 6일
Change
xApp = av_train;
data=xApp (: , 1);
type = 1;
feature=featureExtraction(data,'mean',type);
to
xApp = av_train;
data=xApp (: , 1);
param.method = 'mean';
param.window = 3; % change window size, as needed
param.step = 2; % change step size, as needed
type = 1;
feature=featureExtraction(data,param,type);
  댓글 수: 3
Scott MacKenzie
Scott MacKenzie 2022년 4월 6일
OK, try the modified code in my answer. I'm not sure what window or step sizes might work for you, however.
Nassim CHERIF
Nassim CHERIF 2022년 4월 6일
thank you so much the problem is solved !

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

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 4월 6일
편집: Image Analyst 2022년 4월 6일
Evidently param is not a structure like you thought.
Also
case 'meanVar',feature = movtimavg(data,param.window,param.step,1);
should be on two lines, not one.
  댓글 수: 2
Nassim CHERIF
Nassim CHERIF 2022년 4월 6일
i didnt understand sorry, what should i do to correct that ?
Image Analyst
Image Analyst 2022년 4월 7일
Well, put them on different lines.
case 'meanVar'
feature = movtimavg(data,param.window,param.step,1);

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by