How in Matlab?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mario Marinov
am 16 Sep. 2015
Kommentiert: Star Strider
am 16 Sep. 2015
How to set up a program that introduces a square matrix of numbers from the fourth line? The program should be replaced first positive element in each row 1 and outputting the resulting matrix. Go somewhere and ... Please help!
2 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Sep. 2015
I’m not certain what you want. See if this works:
A=[1 2 3;4 5 6;7 8 9];
A(A(1,:)>0) = 1;
It tests the first column in every row, and if it is positive, replaces it with 1.
2 Kommentare
Star Strider
am 16 Sep. 2015
You have to put parentheses in the subscript references:
A(A(1,:)>0) = 1;
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!