MATLAB: Error when plotting function

function plot error

hello, when i give this function i get the following error will someone please correct me ?
>> fplot(@(a1*sin(b1*x+c1) + a2*sin(b2*x+c2) + a3*sin(b3*x+c3) + a4*sin(b4*x+c4),[0,4000]) fplot(@(a1*sin(b1*x+c1) + a2*sin(b2*x+c2) + a3*sin(b3*x+c3) + a4*sin(b4*x+c4),[0,4000]) ↑ Error: Unexpected MATLAB operator.

Best Answer

Did you read the documentation ?
a1=...;
a2=...;
a3=...;
a4=...;
b1=...;
b2=...;
b3=...;
b4=...;
c1=...;
c2=...;
c3=...;
c4=...;
fplot(@(x)(a1*sin(b1*x+c1) + a2*sin(b2*x+c2) + a3*sin(b3*x+c3) + a4*sin(b4*x+c4),[0,4000])
Related Question