Why I get this error for my code?Error: File: Untitled2.m Line: 10 Column: 8

clear all
Fs = 360; % Sampling Frequency
Fnotch = 0.67; % Notch Frequency
BW = 5; % Bandwidth
Apass = 1; % Bandwidth Attenuation
[b, a] = iirnotch (Fnotch/ (Fs/2), BW/(Fs/2), Apass);
Hd = dfilt.df2 (b, a);
x=load ('100.txt');
x1=x (:, 2);
x2=x1. / max(x1);
Subplot (3, 1, 1), plot(x2), grid on
y0=filter (Hd, x2);
Subplot (3, 1, 2), plot(y0),
noise (baswline wander) Removed'), grid on
Fnotch = 60; % Notch Frequency
BW = 120; % Bandwidth
Apass = 1; % Bandwidth Attenuation
[b, a] = iirnotch (Fnotch/ (Fs/2), BW/ (Fs/2), Apass);
Hd1 = dfilt.df2 (b, a);
y1=filter (Hd1, y0);
Subplot (3, 1, 3), plot (y1), title , grid on
HOW CAN I FIX THIS PROBLEM?

 Accepted Answer

Replace
x2=x1. / max(x1);
by
x2=x1 ./ max(x1);
Be careful with where you add spaces

6 Comments

Clear all
Fs = 360; % Sampling Frequency
Fnotch = 0.67; % Notch Frequency
BW = 5; % Bandwidth
Apass = 1; % Bandwidth Attenuation
[b, a] = iirnotch (Fnotch/ (Fs/2), BW/(Fs/2), Apass);
Hd = dfilt.df2 (b, a);
x=load ('100.txt');
x1=x (:, 2);
x2=x1 ./ max(x1);
Subplot (3, 1, 1), plot(x2), title ('ECG Signal with baswline wander'), grid on
y0=filter (Hd, x2);
Subplot (3, 1, 2), plot(y0), title ('ECG signal with low-frequency noise (baswline wander) Removed'), grid on
Fnotch = 60; % Notch Frequency
BW = 120; % Bandwidth
Apass = 1; % Bandwidth Attenuation
[b, a] = iirnotch (Fnotch/ (Fs/2), BW/ (Fs/2), Apass);
Hd1 = dfilt.df2 (b, a);
y1=filter (Hd1, y0);
Subplot (3, 1, 3), plot (y1), title ('ECG signal with power line noise Removed'), grid on
NOW ITS GIVING A THIS ERROR:Error in Untitled3 (line 1)
Clear all
clear not Clear. Case is significant. And please always show the complete error message.
okey mr.But now its giving that problem:
Error in mert (line 11)
x=load ('100.txt');
Did you rename your script to mert ?
When I run
x=load ('100.txt');
I get the following error message
Error using load
Unable to read file '100.txt'. No such file or directory.
What does your message say?
I rename my script to mert yes.But it gives a error.Error message is unable to read file '100.txt'.No such file or directory.I didnt understand it
Which release of Matlab do you use? I use R2018b.
Understand - why do you believe that load should find 100.txt ?
Matlab looks for files in the current folder and in folders, which are on the Search Path. See What Is the MATLAB Search Path?
In what folder is 100.txt and is that folder the current folder or on the Search Path?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!