MATLAB: Loop for T ( T > 10) = 10;

loop

So I was asked in class to do this at home and I am stumped. I have to write a loop that is equivalent to the command
T ( T > 10) = 10;
Any help is appreciated

Best Answer

  • Loop through the locations in T. When you hit a location that is larger than 10, replace it with 10. Just a simple "for" loop and an "if".