error when plotting function

1 vue (au cours des 30 derniers jours)
Gavin Seddon
Gavin Seddon le 22 Nov 2016
Commenté : Gavin Seddon le 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.

Réponse acceptée

Torsten
Torsten le 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 commentaire
Gavin Seddon
Gavin Seddon le 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])

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by