Eigenvalues for vector inputs..?

1 Ansicht (letzte 30 Tage)
Bradley Stiritz
Bradley Stiritz am 19 Aug. 2012
Hi everyone,
I have two vectors of experimental data which I believe are linearly related (within a close tolerance). I would like to determine the linear coefficients [m,b] that transform vector A to vector B:
vB = m .* vA + b
This is a classic eigenvalue problem, isn't it? I checked out the MATLAB documentation for function eig(), but eig() requires two square matrices as input. I'm not seeing how to recast my problem.
Here's a simple example:
>>vA = rand(10,1);
>>vB = (1.5 .* vB) + 0.5;
What function of vA & vB returns [0.5,1.5], or [1.5,0.5] ..?
Thanks, Brad

Akzeptierte Antwort

Star Strider
Star Strider am 19 Aug. 2012
The reason eig wants two square matrices is that it calculates the similarity transformation matrix that maps one matrix from one coordinate system (set of bases) to another. You might be able to do that if you set your vectors up as companion-form matrices, but I doubt that would be of any real benefit.
In your application, you seem to me to have a simple linear transformation between two vectors (not matrices) that is most appropriate to polyfit:
vA = rand(10,1)
vB = vA*pi + exp(1)
B = polyfit(vA, vB, 1)
B =
3.1416e+000 2.7183e+000
There are many other functions that will do this, but the core MATLAB function polyfit is the simplest.
  2 Kommentare
Bradley Stiritz
Bradley Stiritz am 19 Aug. 2012
Perfect, thank you! Very appreciated :)
Star Strider
Star Strider am 19 Aug. 2012
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by