how do i generate vector
2 次查看(过去 30 天)
显示 更早的评论
hi... how do i generate 2, 6, 5, 3, vectors? in that order
2 个评论
Walter Roberson
2020-10-21
Do you mean that you need to run a calculation that gives you that vector as a result? If so then typically those assignments restrict the operations that are permitted?
回答(1 个)
Ameer Hamza
2020-10-21
A slightly unusual way, but it fulfills the requirement
fun = @(x) round(sin(-0.688014*x + 3.625700) .* exp(-0.367642*x) .* log(2609741*x));
y = fun(1:4)
Result
>> y
y =
2 6 5 3
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Octave 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!