Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | getting error"??? Attempt to execute SCRIPT flipud as a function."

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

getting error"??? Attempt to execute SCRIPT flipud as a function." - ashw...@yahoo.com - Mar 18 12:43:23 2008



hello everyone,
im getting an error when execute this code..how to overcome this error?thank you in advance.

clear all
load data
Fs = 500;
N = 900;
i = [0 : N-1]';

%create the initial signal
%x = sin(2*pi*200* i/Fs) + 0.66*sin(2*pi* 280*i/Fs) + 0.59*sin(2*pi* 60*i/Fs) + 0.5^0.5*randn(
N,1);
x=data(1:N)+5*sin(2*pi*50* i/Fs)+10*sin(2*pi*48* i/Fs);
%create the reference signal of the adaptive filter
u = sin(2*pi*50* i/Fs);

%adaptive filter architecture
L = 20;
step_size = 0.005;
w = zeros(1,L);

%run the adaptive filter
e(L) = x(L);
for k = L : N
regressor = flipud(u(k-L+ 1:k)); 
w = w + step_size * regressor' * e(k);
e(k+1) = x(k) - w * regressor;
end

%compute the spectrum of the initial signal and the filtered signal
f = [0 : Fs/N : Fs/2 - Fs/N]';
F = abs(fft(x));
E = abs(fft(e));

%plot
figure(1);
subplot(411) ;plot(x); title('initial signal');
subplot(412) ;plot(e(2:N+1)); title('initial signal after filtering');
subplot(413) ;plot(f,F( 1:length( f)));title( 'spectrum of initial signal');
subplot(414) ;plot(f,E( 1:length( f)));title( 'spectrum of initial signal after filtering');
figure(2);
plot(i/Fs,x,'b-',i/Fs,e(2:N+1),'r-')
Attempt to execute SCRIPT flipud as a function.

Error in ==> trial1 at 21
regressor = flipud(u(k-L+ 1:k)); 


(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: getting error"??? Attempt to execute SCRIPT flipud as a function." - Ahmad El-Saeed - Mar 19 15:48:25 2008

i am afraid you are making a file name with name flipud ...

what is the name of file of this code ?!
and did you try to edit the function flipud !?

Regards,
Ahmad

On Tue, Mar 18, 2008 at 3:28 AM, <a...@yahoo.com> wrote:

>   hello everyone,
> im getting an error when execute this code..how to overcome this
> error?thank you in advance.
>
> clear all
> load data
> Fs = 500;
> N = 900;
> i = [0 : N-1]';
>
> %create the initial signal
> %x = sin(2*pi*200* i/Fs) + 0.66*sin(2*pi* 280*i/Fs) + 0.59*sin(2*pi*
> 60*i/Fs) + 0.5^0.5*randn( N,1);
> x=data(1:N)+5*sin(2*pi*50* i/Fs)+10*sin(2*pi*48* i/Fs);
> %create the reference signal of the adaptive filter
> u = sin(2*pi*50* i/Fs);
>
> %adaptive filter architecture
> L = 20;
> step_size = 0.005;
> w = zeros(1,L);
>
> %run the adaptive filter
> e(L) = x(L);
> for k = L : N
> regressor = flipud(u(k-L+ 1:k));
> w = w + step_size * regressor' * e(k);
> e(k+1) = x(k) - w * regressor;
> end
>
> %compute the spectrum of the initial signal and the filtered signal
> f = [0 : Fs/N : Fs/2 - Fs/N]';
> F = abs(fft(x));
> E = abs(fft(e));
>
> %plot
> figure(1);
> subplot(411) ;plot(x); title('initial signal');
> subplot(412) ;plot(e(2:N+1)); title('initial signal after filtering');
> subplot(413) ;plot(f,F( 1:length( f)));title( 'spectrum of initial
> signal');
> subplot(414) ;plot(f,E( 1:length( f)));title( 'spectrum of initial signal
> after filtering');
> figure(2);
> plot(i/Fs,x,'b-',i/Fs,e(2:N+1),'r-')
>
> Attempt to execute SCRIPT flipud as a function.
>
> Error in ==> trial1 at 21
> regressor = flipud(u(k-L+ 1:k));
>
>  
>



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )