Error on a single numeric equation
1 次查看(过去 30 天)
显示 更早的评论
I keep getting error at defining f_1(t), is there any other way to input its equation to matlab?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/824845/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/824850/image.jpeg)
0 个评论
回答(2 个)
Walter Roberson
2021-12-6
heaviside not heavyside
heaviside will not convert that table of conditions into appropriate heaviside calls. You can write your code in terms of piecewise() and rewrite() 'heaviside'. But before doing that, use sympref to change Heavisideatorigin
0 个评论
DrZoidberg
2021-12-6
编辑:DrZoidberg
2021-12-6
********************************
EDIT: I'm sorry my answer was not correct, please check the comment below:
1 个评论
Walter Roberson
2021-12-6
This is not correct. You only need to syms the function form if you are going to be using the indefinite form such as taking the derivative before having defined what the function is.
syms t
f1(t) = 1
is not an error due to syms f1(t) not having been used.
Instead it is an error because the form requires a symbolic right hand side
syms t
f1(t) = sym(1)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!