Info

この質問は閉じられています。 編集または回答するには再度開いてください。

why my Matlab code is not passing the test suite? [Cody]

1 回表示 (過去 30 日間)
Chandan Gupta
Chandan Gupta 2020 年 6 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
function a = ten2pow4(n)
format rat
c = zeros(1, n+1);
if n>0
c(2) = 2;
for i = 2:n
for r = 1:i-1
c(i+1) = c(i+1) + (((10^(i)/(i-1))-4^(r)*c(r+1))/(4^(i) + 1));
end
end
else
c(1) = 1;
end
c(1) = c(n+1);
a = flip(c);
end

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by