How to get the index of the first non-zero element in an 1-D array in SIMULINK
Mostra commenti meno recenti
Hi, guys
I want to find the index of the first non-zero element in a 1-D array in simulink, just like the way that 'find' command in matlab did.
For example:
x = [0 0 5 0 3 0];
idx = find(x~=0, 1, 'first');
The answer would be:
idx = 3.
So, how to do this in simulink?
Thanks!
by Ben
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Array and Matrix Mathematics in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!