Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

hi ,im doing gui. there are 3 push button , one push button load folder x, one push button load folder y and one push button divide value from push button one and two, but im having this error

1 visualización (últimos 30 días)
??? Undefined function or variable 'RMSmaxf_before'.
Error in ==> enfaiz>pushbuttonFRRBEFORE_Callback at 198 MF=RMSmaxf_before
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> enfaiz at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)enfaiz('pushbuttonFRRBEFORE_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback

Respuestas (2)

Chiranjit
Chiranjit el 23 de Mayo de 2013
it seems you have not define RMSmaxf_before
why dont you put your code here so that we can look at it

nur hidayah
nur hidayah el 23 de Mayo de 2013
% --- Executes on button press in pushbuttonflex.
function pushbuttonflex_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonflex (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[fname,dirpath]= uigetfile('*.xlsx')
num = xlsread([dirpath,fname])
%
%
time_flex=num(:,1);
emgsignal_flex=num(:,3);
fs=1000
nfft=512;
f=(0:nfft-1)*(fs/nfft); % % butterworth
n=4; Wn=40/500;
[b ,a] = butter (n,Wn,'high');
fsig_x=filter (b,a,emgsignal_flex);
rms_flexion_before=[6001:9002,3]
rms_extension_before=[9003:11000,3] %
step=75;
window=75;
wavSigf_before=fsig_x(rms_flexion_before)
% RMS of wavSigf
lx = length(wavSigf_before);
i=1;
while(i<lx/step-window/step)
X = wavSigf_before(1+(i-1)*step:(i-1)*step+window);
yf(i)=sqrt(mean(X.*X));
i=i+1;
end
%max (yf)=RMSmaxf_before
RMSmaxf_before=max (yf)
guidata(hObject, handles);
% % --- Executes on button press in pushbuttonfullflex.
function pushbuttonfullflex_Callback(hObject, eventdata, handles)
% % hObject handle to pushbuttonfullflex (see GCBO)
% % eventdata reserved - to be defined in a future version of MATLAB
% % handles structure with handles and user data (see GUIDATA) % % [fname,dirpath]= uigetfile('*.xlsx')
num = xlsread([dirpath,fname])
time_fullflex=num(:,1);
emgsignal_fullflex=num(:,3);
fs=1000
nfft=512;
f=(0:nfft-1)*(fs/nfft); % % butterworth
n=4; Wn=40/500;
[b ,a] = butter (n,Wn,'high');
fsig_y=filter (b,a,emgsignal_fullflex);
rms_fullflexion_before=[6001:9002,6]
step=75;
window=75; % % wavSigff_before=fsig_y(rms_fullflexion_before)
% RMS of wavSigff
lx = length(wavSigff_before);
i=1;
while(i<lx/step-window/step)
X = wavSigff_before(1+(i-1)*step:(i-1)*step+window);
yff(i)=sqrt(mean(X.*X));
i=i+1;
end
%mean (yff)=RMSavgff_before
RMSavgff_before=mean (yff)
guidata(hObject, handles);
% % --- Executes on button press in pushbuttonFRRBEFORE.
function pushbuttonFRRBEFORE_Callback(hObject, eventdata, handles)
% % hObject handle to pushbuttonFRRBEFORE (see GCBO)
% % eventdata reserved - to be defined in a future version of MATLAB
% % handles structure with handles and user data (see GUIDATA) % % % %
handles.output=hObject;
MF=RMSmaxf_before
AFF=RMSavgff_before
FRR_before= (MF/AFF);
and the error is above...

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by