You must convert the mathematical notation to a syntax recognized by Matlab.
For example, this segment,
becomes any of the following
t = linspace(0,92*pi,5000);
-1/38 * sin(17/11 - 37*t) - 1/30 * sin(31/21 - 35*t)
-1/38 * sin(17/11 - 37.*t) - 1/30 * sin(31/21 - 35.*t)
((-1/38) * sin((17/11) - (37.*t))) - ((1/30) * sin((31/21) - (35.*t)))
The key points are
- n(sin(x)) must become n*sin(x) or n.*sin(x) depending on the array sizes. You want element-wise operations.
- Undersand the order of operations, or use parentheses to group your terms.
- Frequently run sections of the equation as you convert each set of terms so you can catch errors early on. The output should be equal in size to the variable t.
- For square roots, use sqrt().
- As indicated in the WolframAlpha link you shared, theta(x) is the Heaviside step function.
- Also indicated in the link, sgn is the sign function.
Update
Due to the negative associations this image may have with current social issues (which I just learned about), I'll refrain from continuing with this thread. I hope the answer helps to learn about converting mathematical notation to Matlab syntax but please be socially minded with the meme.
Best Answer