error when plotting function

1 Ansicht (letzte 30 Tage)
Gavin Seddon
Gavin Seddon am 22 Nov. 2016
Kommentiert: Gavin Seddon am 23 Nov. 2016
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.

Akzeptierte Antwort

Torsten
Torsten am 22 Nov. 2016
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])
  1 Kommentar
Gavin Seddon
Gavin Seddon am 23 Nov. 2016
your command failed due to missing bracket. however now this produces a chaotic graph rather than a function will you help? i have been using matlab help, where should i look >> fplot(@(x)(a1*sin(b1*x+c1) + a2*sin(b2*x+c2) + a3*sin(b3*x+c3) + a4*sin(b4*x+c4)),[0,4000])

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by