Matlab assignment
Watch this threadPage 1 of 1
georgia.ap_
Badges:
1
Rep:
?
You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#1
I am tying to generalise my code for an ECG signal into a MATLAB function taking the first input as any signal and the second as the filter length, with output smoothed signal. This is my code:
function[slidingavg]=G_function(ecg_emg,fl)
if isinteger(fl)
if isnumeric(ecg_emg)
len=length(ecg_emg)
for l=1:len-fl
p=0
for m=0:5-1
p=(p+ecg_emg(l+m))
end
slidingavg(l)=p/l
end
else
print('yes')
end
else
print('databad')
end
An error is being displayed, Where am i going wrong?
Thankyou!!
function[slidingavg]=G_function(ecg_emg,fl)
if isinteger(fl)
if isnumeric(ecg_emg)
len=length(ecg_emg)
for l=1:len-fl
p=0
for m=0:5-1
p=(p+ecg_emg(l+m))
end
slidingavg(l)=p/l
end
else
print('yes')
end
else
print('databad')
end
An error is being displayed, Where am i going wrong?
Thankyou!!
0
reply
X
Page 1 of 1
Quick Reply
Back
to top
to top