Make spceficic array values zero.
Mostra commenti meno recenti
Hi Mathworks community!
I'm having trouble trying to make some of my array values zero. This array corresponds to my Input:
Input = [-1 0 -1 0 0 NaN NaN NaN NaN -1 0 -1 -1 -1 0 NaN NaN NaN 0 0 -1 0 -1 NaN NaN NaN]
I'd like to make everything inside the array zero, but the last -1 before every NaN series. This should be the expected Output:
Output = [0 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 0 0]
Could someone please help me out?
Thank you,
Santos
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Resizing and Reshaping Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!