what dos this instruction mean
Afficher commentaires plus anciens
i meet this instruction when analyzing a matlab file could you help me what does it mean ?
yone=(y==i)+(y~=i)*-1;
when y is a column vector and i is fix number i=4;
what will be the size of yone in this case ?
Réponses (1)
Walter Roberson
le 16 Mai 2013
0 votes
A value of "1" where the entries are "i", and a value of "-1" where the entries are not "i", and 0 where the entries are NaN.
1 commentaire
Jan
le 16 Mai 2013
Equivalent:
yone = 2 * (y==i) - 1;
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!