Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

RaquelF

Electrical
Joined
Mar 16, 2015
Messages
1
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!
 
Is this for school? Student posting is not allowed

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529


Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top