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
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.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by