Use the following to get started n k1 SolutionThe Matlab fun
Use the following to get started:
n k=1Solution
The Matlab function my_boundcheck.m
function n = my_boundcheck( x,bound) % The function my_boundcheck.m
y = 0; %initial value of y
k = 0; % Intitial value of k
while y<=bound % loop til y reach bound
k = k+1; % Incrementing the value of k
y = y + k*nthroot(x(k),3); % evaluating sum
end % end of loop
n = k-1; %The value of n is the previous k value
end
Testing the function my_boundcheck.m
>> x = 27*ones(1,100);
>> bound = 100;
>> n = my_boundcheck(x,bound)
n =
7
