here is my problem:
I have in input a vector of size 31, filled alternatively with zeros or doubles (e.g. [2 8 3 0 0 0 0 0 5 7...]). What i need to do is sum the different series of non-zeros values and output them in another vector, keeping zeros between those values. With the previous vector, that would give: [13 0 12...].
I also know that there will be a problem if the number of series isn't always the same, but i think i could find a trick to avoid that problem. I did that in a Matlab function embedded in my Simulink code, but I heared Simulink code was much more performant than Matlab for embedded systems.
Do you have any idea on how I could do this?
Thank you for your answers,