Info
This question is closed. Reopen it to edit or answer.
hai,,actually i have problem how to divide these two number from two different push button, the error here ??? Undefined function or variable 'RMSmaxf_before'. Error in ==> enfaiz>pushbuttonFRRBEFORE_Callback at 198 MF=RMSmaxf_before Error in ==>
2 views (last 30 days)
Show older comments
There are 3 push buttons, push button number 1:
% --- 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);
% step=75;
% window=75;
% %
% wavSige_before=fsig_x(rms_extension_before)
% % RMS of wavSige
% lx = length(wavSige_before);
% i=1;
% while(i<lx/step-window/step)
% X = wavSige_before(1+(i-1)*step:(i-1)*step+window);
% ye(i)=sqrt(mean(X.*X));
% i=i+1;
% end
%
% RMSmaxe_before=max (ye)
% %
% guidata(hObject, handles);
There are two push buttons like the coding above, and I need to divide between these two buttons. For example I need to divide y(f) with y(e)and I don't know how to divide, the example error is above.
0 Comments
Answers (1)
Image Analyst
on 26 May 2013
This will answer nearly all your problems: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/ Knowing that, you will be able to see where RMSmaxf_before is, and is not, defined.
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!