Matlab assignment

Watch this thread
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
Report Thread starter 7 months ago
#1
How do i generalise my matlab coding for a sliding average filter applied to my ecg data values to take an input of any filter length.
this is my current code which displays an error:
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

Any help would be appreciated,
Thankyou!
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Were exams easier or harder than you expected?

Easier (19)
27.54%
As I expected (22)
31.88%
Harder (25)
36.23%
Something else (tell us in the thread) (3)
4.35%

Watched Threads

View All