Which function provide this output?
显示 更早的评论
Hello everyone!
I need a function f(x), where x are positive integers, that provides the following output pattern:
x: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18...
f(x): 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6...
Thanks in advance!
3 个评论
Walter Roberson
2021-3-6
Hint:
remainder when 1 is divided by 8 is 1, target value is 7, sum of remainder and target value is ...
remainder when 2 is divided by 8 is 2, target value is 6, sum of remainder and target value is ...
Basil C.
2021-3-6
I think you mean difference of remainder and target value @Walter Roberson
Walter Roberson
2021-3-6
No, I mean sum. 1 remainder, desired value is 7, sum is 8
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!