How to do the DoubleDown function?
显示 更早的评论
function finalValue = DoubleDown( initialValue )
% Complete the function to return twice the initialValue
finalValue = 0;
%supposed to make finalValue = 10 and then 240
end

%
4 个评论
Jan
2017-9-16
@Blair: "return twice the initialValue" seems to be very clear already. "twice" means "2 *". What exactly is your problem?
Blair Hall
2017-9-16
Geoff Hayes
2017-9-16
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)
回答(1 个)
Francisco Aguiniga-Garcia
2020-9-29
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!
类别
在 帮助中心 和 File Exchange 中查找有关 Variables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!