Simple Iterative expression needed solved

Assuming w is an integer (w = 1, 2, 3, …), write an iterative calculation to determine the minimum w value that will bring the result of the following expression to greater than 10,000. Display this minimum w value and the corresponding result of the expression.

Respuestas (2)

Walter Roberson
Walter Roberson el 30 de Abr. de 2020

0 votos

initialize. while the condition is not met, increment.

4 comentarios

James Paltani
James Paltani el 30 de Abr. de 2020
i have almost no programming knowledge, how?
James Paltani
James Paltani el 30 de Abr. de 2020
Editada: James Paltani el 30 de Abr. de 2020
This is what i have so far.. it says illegal "greater than" operator. What should i differently
clc,clear
syms w
e = sqrt((10*w^2)-4*w+2);
for e > 10000,
solve(w)
syms w
e = sqrt((10*w^2)-4*w+2);
w = ceil(max(double(solve(e==10000))));
But this does not use a loop like you are required to do. You should not be using symbolic toolbox for this problem.
You should be initializing w to the lowest value of the range. Then you calculate e based on that w. Test whether it has reached the necessary value yet. If it has not, increment w and recalculate e and loop back.

Iniciar sesión para comentar.

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath el 30 de Abr. de 2020
w = 1; y = 0;
while(y < 10000)
% your equation
y = sqrt(10*w*w - 4*w + 2);
w = w + 1;
end
disp(w)
disp(y)

1 comentario

Walter Roberson
Walter Roberson el 30 de Abr. de 2020
We recommend against providing complete solutions to homework assignments.

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 30 de Abr. de 2020

Comentada:

el 30 de Abr. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by