how to express the below equation in matlab, consider the roll off factors are 0,0.25,0.5,0.75,1
1 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
Stefan Raab
2015-10-21
Depending on what you want, there are several ways to do this:
1) Set alpha to the desired value and t to an array of your timeseries. Then you can get a vector for g by simply implement the equation by: g = . . .; Probably you have to use .* for multiplications with t, then Matlab will do an element-wise multiplication.
2) Create an anonymous function with i.e.
g = @(t,alpha) sin(alpha*pi*t); % Your function here
Then you can call the function via g(t,alpha) with your desired values.
3) Write a new function file, which you can call directly. Otherwise you can also create a handle for it, similar to the anonymous function
For 2) and 3) you can also search for function handles in the Matlab doc.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!