How can I store wavelet values in an array while using a loop in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter Abdullah266
  • Start date Start date
  • Tags Tags
    Matlab Wavelet
Abdullah266
Messages
1
Reaction score
0
Hi all,
I want to generate a ricker wavelet using MATLAB then I convolve it with the Earth reflictivity (e) to get a seismic trace

I have (e) and I would like to generate ricker using the equation
w=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2)
between t:dt:tf

I use loop in MATLAB to get the wavelet

for t=0:0.001:0.05
w=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2);
end

the problem is that MATLAB assign each w= a value
and when I convolve it with the e it convolve only the last value in w
so I want to get w in the form w=[ value1 value2 value ..]
insted of getting it
w= value1
w= value2
w=value 3
.
.
.

please I need your urgent help
 
on Phys.org
You have to store the values in a array, otherwise only the last value at t=0.05 will be stored in w.
Make w as an array like this
w(t/0.001+1)=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2);

Now w will have all values as desired.
For any help regarding arrays please refer to Matlab help documentation.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
18K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K