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
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!!
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 (17)
27.87%
As I expected (17)
27.87%
Harder (24)
39.34%
Something else (tell us in the thread) (3)
4.92%

Watched Threads

View All