create a function for integration
2 次查看(过去 30 天)
显示 更早的评论
Hi, i have a function that has to be evaluated to generate a signal. I am having trouble writing it in matlab. Any help is much appreciated The set of equations that define the signal is defined in the image attached,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162799/image.png)
The values of C1 and C2 in the equation are as follows, C1=4; C2=0.0187; and 't' will be the time instant signal=1.3*sin(v(t));
please feel free to consider arbitrary values for the other terms that i have not specified, thanks in advance
0 个评论
回答(1 个)
John D'Errico
2017-4-10
编辑:John D'Errico
2017-4-10
I'm a bit confused by your question. You can do the integration using pencil and paper. This reduces to a simple exponential function of t, with a few constants in there. Substitute K(t) into v(t), then integrate. Since you state that all other values are constants, then you can trivially compute the result as the constant f.
So the symbolic toolbox will have no problems or you can do a numerical integration, using integral, IF you define all the unknown parameters (thus Trec, wmin, and wmax). You CANNOT perform a numerical integration with unknown constants in the problem, because numerical integration tools (like integral, quad, etc) use adaptive methods that would be impacted by the values of those unknown constants.
The only point where there is an issue is your comment that
"and 't' will be the time instant signal=1.3*sin(v(t));"
Sorry, but this statement is mathematically meaningless, and apparently irrelevant to the problem of integration of v(t), since v(t) has no connection to anything called signal.
For some reason, you seen to think that a definite integral (with fixed limits) will be a function of t. Thus you have written it as f(t). There is no functionality on t there anymore. You integrated on the variable t, between two limits. There is no f(t). Only the constant value f.
As for the computation of something called signal, the integration itself is irrelevant. You can compute v(t). Therefore you have
signal=1.3*sin(v(t));
directly, with NO integration necessary.
So you need to explain what you are doing far more clearly, or you need to rethink what you are trying to do. I say this because what you have asked is either trivial, or it makes no mathematical sense at all.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!