Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Status
Not open for further replies.

RaquelF

Electrical
Mar 16, 2015
1
0
0
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!
 
Replies continue below

Recommended for you

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.
Back
Top