Afficher commentaires plus anciens
Hi,
I have x and y values which represent some sort of sin wave but I don't know the function. something like x = [1.190984579 1.15776987 1.12455516 1.096085409 1.067615658 1.034400949 1.003558719 0.975088968 0.944246738 0.911032028 0.877817319 0.846975089 0.825622776]
y = [0.526690391 0.517200474 0.519572954 0.533807829 0.550415184 0.56227758 0.552787663 0.536180308 0.521945433 0.521945433 0.524317912 0.517200474 0.495848161]
I want to draw tangent line on the point I specify. Please help me do it.
Thanks.
Réponse acceptée
Plus de réponses (3)
Judah S
le 26 Juin 2011
5 commentaires
Andrew Newell
le 26 Juin 2011
It depends on what you are trying to do. To me, these points look like a coarse sampling of a smooth function. If so, you're computing a secant, not a tangent. That's why I suggested fitting the function.
A minor point: the function fails if you choose the starting point or end point of the curve.
Judah S
le 26 Juin 2011
Andrew Newell
le 26 Juin 2011
Actually, m2 works pretty well.
Judah S
le 26 Juin 2011
Andrew Newell
le 26 Juin 2011
Glad you like it! I agree, derivest is very cool.
Judah S
le 30 Juin 2011
0 votes
Judah S
le 2 Juil 2011
0 votes
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!