How to write if statement for logical value
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kamil Kacer
el 24 de Nov. de 2020
Comentada: Kamil Kacer
el 24 de Nov. de 2020
Hi this is my Result matrix I converter them to logical values as shown below(dont know if it is neccecery)
And now I wnat to write if statement
if number of 1s in first column is greater then number 0 give me one else give me 0;
How do i do it for each column.
Thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/426793/image.png)
Result{1}(:,1) = logical(Result{1}(:,1));
Result{1}(:,2) = logical(Result{1}(:,2));
Result{1}(:,3) = logical(Result{1}(:,3));
0 comentarios
Respuesta aceptada
Más respuestas (1)
Ver también
Categorías
Más información sobre Operators and Elementary Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!