photo

Randall Ang


Last seen: plus de 3 ans il y a Actif depuis 2020

Followers: 0   Following: 0

Statistiques

  • First Answer
  • Thankful Level 1

Afficher les badges

Feeds

Afficher par

Réponse apportée
Homework: Write a function called char_counter that counts the number of a certain character in a text file.
This is my solution, u can take a look for other alternatives. function charnum = char_counter(fname,character) %fname - char ...

plus de 4 ans il y a | 0

Question


Hi everyone, I have been trying to debug this for loop as it always retain the last value of the array even if none of the conditions meet for every element. For instance, using readings = [1 20 55 90], it will print that reading(4)>100.
for ii = 1:length(readings) if readings(ii) > 100 break; end end fprintf('First reading above 100 is at in...

plus de 4 ans il y a | 1 réponse | 0

1

réponse