Hey i need help with this. i am trying to have this function give me different values for each value of x i enter in the script but it keeps giving me just one value
Mostrar comentarios más antiguos
function [y] = sample_for(x)
%SAMPLE_FOR Summary of this function goes here
% Adjust scores sent to the function as either scalar or vector depending on what was sent
for x=1:10
y=x+((10/100)*x);
end
This is the function, but when I run it with lets say x=5 it gives me the result for x=10. I need it to give the correct value for each x I enter. please I need help!!
4 comentarios
Brenda Egbe
el 21 de Oct. de 2018
Brenda Egbe
el 21 de Oct. de 2018
madhan ravi
el 21 de Oct. de 2018
Editada: madhan ravi
el 21 de Oct. de 2018
select the code and press the code button{},see my answer below
Brenda Egbe
el 21 de Oct. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Functions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!