So I have a matrix full of 25 iterations of a code (ends up as 75x25). For each iteration I wanted to calculate the width of the peak thats created, and I did this by using findpeaks. The problem is that my resulting width vector only includes 10 widths, and I'm assuming its because the other iterations do not have a peak, so the width is an empty array . Is there a way I can insert zeros when they occur?
This is what I've tried
[pks1(i,1), loc1(i,1), width1(i,1), prom1(i,1)]= findpeaks(XmRNA(:,i),t);
I tried using is empty but my resulting width vector doesnt include the empty arrays () so it doesnt work. (To clarify my width1 vector is 10 numbers, so there are no empty arrays to change to zero).
Any help is welcome!