How to calculate approximation error from 1x1 and 1x1001 symbolic signals

2 views (last 30 days)
Hi,
I need to calculate the approximation error from two signals, one is a triangularPulse function from matlab( which generates 1x1 symbolic), and the other one is a 1x1001 symbolic. How can I split the triangularPulse into a 1x1001 array so I can calculate the error?

Answers (1)

Star Strider
Star Strider on 24 Mar 2019
Much depends opn how you defined your triangularPulse.
One option:
syms x T(x)
T(x) = triangularPulse(x);
Tfcn = matlabFunction(T);
t = linspace(-1, 1, 1001);
Tvct = Tfcn(t);
figure
plot(t, Tvct)
grid on
The plot call simply presents the result. It is not necessary for the code.
Experiment to get the result you want.

Products

Community Treasure Hunt

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

Start Hunting!