![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179566/image.jpeg)
Any idea on how to build this function?
2 次查看(过去 30 天)
显示 更早的评论
Hello forum, I should build a MATLAB function that will plot the red function:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170099/image.jpeg)
In particular, I know the f0 frequency so: - the first period is T0=1/f0, and I want that from 0 to T0 the frequency is fixed at level f0; - than the frequency passes to f1=f0+k*T0 (k is a known constant) and the period is T1=1/f1 and so on.
Do you have any idea on how to build it?
0 个评论
回答(2 个)
Andrei Bobrov
2017-11-24
Let T - your T0,T2 and etc. (T = [T0,T1,...,TN]);
f - your f0,f1 and etc. (f = [f0,f1,...fN]).
function F = yourfreq(t,T,f)
ii = discretize(t,[0, T]);
F = f(ii);
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Conditional Mean Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!