A(B)=0 What is its meaning?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
zhenyu zeng
am 6 Mär. 2019
Bearbeitet: Torsten
am 6 Mär. 2019
A=rand(5)
B=A>0.8
A(B)=0
Can you tell me what is A(B)=0 meaning?
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 6 Mär. 2019
B is a logical index matrix. You can see the value is 1 (true) or 0 (false) wherever the corresponding value in A is greater than 0.8.
A(B)=0 means for all those places where B's value is true, set the corresponding value in A to 0.
Use this example to see it better.
A=magic(5)
B=A>10
A(B)=0
3 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB 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!