Defining variables inside of a function
显示 更早的评论
t = 0:0.1:2; y(t) = cos(2*t); Array indices must be positive integers or logical values.
My problem here is that I want to have the variable "t" known inside the parentheses beside "y" as a regular written function in Matlab but I can't figure it out I tried searching for it online and found nothing.
采纳的回答
更多回答(1 个)
Stephen23
2018-10-7
t = 0:0.1:2;
y = cos(2*t);
类别
在 帮助中心 和 File Exchange 中查找有关 Common Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!