find indices in a large array and replace them with zeros
Ältere Kommentare anzeigen
I have an index with 10 rows and 301 columns each. I also have a digital signal with 1 X 250,000 elements. The values of the initial index are isolated from the digital signal because they all have a specific characteristic and I used the following code for this:
index1 = zeros(10,151);
index2 = zeros(10,150);
for i = 1:10
index1(i,:) = signal(peak(i):(peak(i)+150));
index2(i,:) = signal((peak(i)-150):(peak(i)-1));
end
index = [index2,index1];
Up to this point everything is fine. However, I want to delete that characteristic by replacing all the index values with zeros back at the digital signal. My problem is that the element arrays in the "index", corresponding to the 10 rows, aren't neighbouring. How can I do this? Would it be easier if I make the replacement within the for loop? Thanks in advance.
1 Kommentar
Azzi Abdelmalek
am 17 Aug. 2016
This is not clear
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!