error when plotting function

2 visualizaciones (últimos 30 días)
Gavin Seddon
Gavin Seddon el 22 de Nov. de 2016
Comentada: Gavin Seddon el 23 de Nov. de 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.

Respuesta aceptada

Torsten
Torsten el 22 de Nov. de 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 comentario
Gavin Seddon
Gavin Seddon el 23 de Nov. de 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])

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by