Shape of data lsqnonlin

Hello,
I'm attempting to fit parameters to a model that is expm(A*t)*X-y with lsqnonlin.
I've concatenated my values for t onto my X values as I couldn't get lsqnonlin to work with two seperate 'input' vectors so my function now looks like
fun = @(A) expm(A*X(4))*[X(1); X(2);X(3)] - [y(1); y(2); y(3)].
My question is, should X and y be (n x 4) and (n x 3) respectively or the transpose of this?
I should add that, in my actual "fun" line, I have broken A into it's components and put into a Matrix so I'm not sure if im doing that wrong i.e. [A(1) A(2) A(3); A(4) etc]
Thanks for any help

Answers (0)

Categories

Products

Release

R2020a

Asked:

on 22 Apr 2021

Community Treasure Hunt

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

Start Hunting!