Community Profile

photo

Randall Ang


Last seen: presque 3 ans il y a Actif depuis 2020

Statistiques

  • First Answer
  • Thankful Level 1

Afficher les badges

Content Feed

Afficher par

A répondu
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 ...

presque 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...

presque 4 ans il y a | 1 réponse | 0

1

réponse