Replace specific numbers in a matrix
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Fahad Mirza
am 2 Feb. 2014
Kommentiert: Fahad Mirza
am 2 Feb. 2014
I am in a noob level right now. So, question might look silly. But here is it anyway:
I have a matrix of 10x10 with integer numbers. I need to find the numbers which are greater then 90 and replace it with 'inf'. I can replace those numbers with zero by using conditional operator. Like: A = A.*(A<90)
But how can I replace them with 'inf'? I know I can use 'for' and 'if-else'. But there must be more elegant way to do that I guess.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Entering Commands finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!