saving the vector data to matrix after shifting with window
1 view (last 30 days)
Show older comments
Hi all,
I have a double 1x223 vector data. I want to slice and save the data for my giving parameters forexample the x variable from 0 to 1100 and the increment is 5 km. When user select a window 200 then the program will find in x value for example it is 41th value so change the data as 1,1:41, then a user should give shifting value such as 10 km for example 10km equals to 3th value in the x so the second row should be 2,3:43 so on it goes 1:92,183:223 at the end. I need 1:92:1:41 matrix at the end for this example.
I wrote this example but I could not achieve to run it correctly. Please help me.
%%%%%
A = load('Profil1veri_resampled.dat');
goz=A(:,2);
L=input('enter the window length (km)= '); lx=input('enter window shifting (km)= '); [row,col]=find(xk==L); [row2,col2]=find(xk==lx); m=row2-1; xnewtotal=((max(xk)-(2*(L/2)))/lx)+1;
goz=goz';
for n=1:xnewtotal
gozz(n,1:nmax)=goz(1:nmax);
end
for k=1:xnewtotal;
for i=row:m:nmax
for j=1:m:nmax-row+1
goz2(:,:)=gozz(k,j:i);
end
end
end
Thanks
0 Comments
Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!