Does lsqlin give different solution if the rows of C matrix and d matrix are changed accordingly?
1 view (last 30 days)
Show older comments
Thanigaivel Raja T
on 22 Aug 2016
Commented: Thanigaivel Raja T
on 22 Aug 2016
I have two curves(or datasets) which are to be fitted of the form, C1.x=d1 and C2.x=d2, where x is the solution which should satisfy both equations. Here C1 has several subsets of data, for example C1=[c11; c12; c13...] with an associated fit data d1=[d11; d12; d13;..]. Similarly C2 has several subsets of data, for example C2=[c21; c22; c23...] with an associated fit data d2=[d21; d22; d23;..]. So I had clubbed both C1 and C2 into a single matrix and d1 and d2 into single matrix, so that I have the form C=[C1;C2] =[c11;c12;c13;c21;c22;c23] and d=[d1;d2]=[d11;d12;d13;d21;d22;d23]. Then upon solving using lsqlin, I get a solution 'x'.
Alternatively, upon merging the C1 and C2 in different manner, say C=[c11;c21;c12;c22;c13;c23] and correspondingly reordering d as d=[d11;d21;d12;d22;d13;d23] and then solving using lsqlin, I get a solution 'x'.
The solution 'x' for both the cases seemed to be different for my problem in hand. So I tried it with a small random dataset, but here the solution 'x' was same in both cases.
Now I in confusion, if changing the rows of the C matrix and correspondingly changing the d matrix, yield the same solution or not?
Or, can't lsqlin be used for curve fitting multiple independent datasets?
Thanks in advance.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!