How to write if statement for logical value
Ältere Kommentare anzeigen
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

Result{1}(:,1) = logical(Result{1}(:,1));
Result{1}(:,2) = logical(Result{1}(:,2));
Result{1}(:,3) = logical(Result{1}(:,3));
Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 24 Nov. 2020
Keep as matrix.
sum(Result)>0;
Kategorien
Mehr zu Aerospace Blockset finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!