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!