MATLAB Answers

how do you separate time data from signal data, plot the signal, followed by the removal of the trend without using the inbuilt ‘detrend’ function

3 views (last 30 days)
James Adams
James Adams on 19 Feb 2020
Answered: Hiro on 19 Feb 2020
%%. Load a signal_txt in Matlab using the importdata function. I then need to separate the time information from the signal information and plot the signal. I finally need to remove the trend without using the ‘detrend’ function.
%Task 1a
%%Heres my script code
t = signal1(:,1); %Load time data into variable t
a = signal1(:,3); %Load amplitude data into variable a
plot(t,a); %Plot time against amplitude
%%Heres my test code
x = 0:pi/100:2*pi;
y = sin(x);


Sign in to comment.