How to do the DoubleDown function?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
function finalValue = DoubleDown( initialValue )
% Complete the function to return twice the initialValue
finalValue = 0;
%supposed to make finalValue = 10 and then 240
end

%
4 commentaires
Geoff Hayes
le 16 Sep 2017
DoubleDown(5) is how you call your function from the command line (or from within another function). Calling your code like this
>> DoubleDown(5)
should return
ans =
10
Presumably the second number (240) is returned when you call your function as
>> DoubleDown(120)
Réponses (1)
Francisco Aguiniga-Garcia
le 29 Sep 2020
function finalValue = DoubleDown( initialValue )
% Complete the function to return twice the initialValue
finalValue = 2*initialValue;
end
%This code worked foe me! Hope it works for you as well!
0 commentaires
Voir également
Catégories
En savoir plus sur Variables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!