×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to compare two vectors with their shapes and values? Using Matlab

How to compare two vectors with their shapes and values? Using Matlab

How to compare two vectors with their shapes and values? Using Matlab

(OP)
Hi!
I want to correlate two vectors not only in their shape but also considering their values in matlab. The functions i've searched (like, corrcoef/corr/corr2...) give the R-value, but that just consider the shape of the curve that the vectors represent, and i want to know also how close their values are. Is there any function that consider these both criteria(shape and values)?

To explain better:
Consider three vectors with values of 'sin(x)', '2*sin(x)' and '4*sin(x)'.
Using 'corr2' to correlate 'sin(x)' with '2*sin(x)' or 'sin(x)' with '4*sin(x)', once the shapes of the three vectors are the same, it will always return the same values of 'r', i.e. the value 1. But what i need is a function or something like that, that tells me not only that '2*sin(x)' has the same (or close in the case of my vectors) shape of 'sin(x)' but also that it is closer to my values than the vector '4*sin(x)'.

Thank you so much in advance!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources