I have a sine function y = a*sin(bx+c)+d and I have 4 points on the function: P1(0.835,0.720) P2(1.498,0.589) P3(2.866,0.236) P4(3.299,0.649)?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Julianna
el 25 de Nov. de 2014
Respondida: Torsten
el 25 de Nov. de 2014
I then plug them into the equation and get the following 4 functions:
0.720 = a*sin(0.835b+c)+d
0.589 = a*sin(1.498b+c)+d
0.236 = a*sin(2.866b+c)+d
0.649 = a*sin(3.299b+c)+d
Does anyone know how I can solve these equations to get all 4 variables?
0 comentarios
Respuesta aceptada
Youssef Khmou
el 25 de Nov. de 2014
hi, if you have Math symbolic ToolBox, you can use the function solve, the output is a structure with symbolic variables :
S=solve('0.720 = a*sin(0.835*b+c)+d','0.589 = a*sin(1.498*b+c)+d','0.236 = a*sin(2.866*b+c)+d',...
'0.649 = a*sin(3.299*b+c)+d');
%S.a
0 comentarios
Más respuestas (1)
Torsten
el 25 de Nov. de 2014
Use MATLAB's fsolve:
a=-0.416512038
b=-2.44492318
c=1.06244590
d=0.374304977
Best wishes
Torsten.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!