or() in categorical variable
Mostrar comentarios más antiguos
I don't know why the results of index1 and index2 are different.
The variable
financial_status=[1,2,3,4,5];
index1 = find(financial_status==or(1,2));
index2 = find(financial_status>=1&financial_status<=2);
2 comentarios
dpb
el 23 de Nov. de 2020
Because
>> or(1,2)
ans =
logical
1
>>
TAEKYU EOM
el 23 de Nov. de 2020
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 23 de Nov. de 2020
Editada: Walter Roberson
el 23 de Nov. de 2020
ismember(financial_status, 1:2)
At the moment I cannot think of any computer language that expresses a set membership test in terms of an equality test. Which computer language were you inspired by?
1 comentario
TAEKYU EOM
el 23 de Nov. de 2020
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!