MATLAB Answers

How to store values from toc into an array

47 views (last 30 days)
Raiven Balderas
Raiven Balderas on 7 Feb 2018
Edited: Walter Roberson on 7 Feb 2018
help with bonus question

  1 Comment

Raiven Balderas
Raiven Balderas on 7 Feb 2018
i need help with question 5 and the bonus depicted in the screenshot/attachment

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 7 Feb 2018
tic;
for K = 1 : 10
times(K) = toc;
end

  6 Comments

Show 3 older comments
Walter Roberson
Walter Roberson on 7 Feb 2018
Only initialize timeslow to zero before the for loop, not in the for loop.
Walter Roberson
Walter Roberson on 7 Feb 2018
You write a function named prime_count that takes n as an input and returns a vector named Upsilon which is of length n, each element of which is the number of prime numbers less than or equal to its index. The function prime_count must call prime_sieve exactly once -- however, it is not required that your function use the results returned by prime_sieve .

Sign in to comment.

Sign in to answer this question.

Tags