MATLAB: What is wrong with: [betta;del​ta;gamma]=​inv([ab ab_cd -cd])*[C-A];

multiplicationvectors

Hi
[betta;delta;gamma]=inv([ab ab_cd -cd])*[C-A];
betta, delta and gamma should be scalars.
ab, ab_cd, cd, C and A are column vectors with 3 rows (e.g. [1;2;3]).
I want that
betta = leftvektor(1)
delta = leftvektor(2)
gamma = leftvektor(3)
Matlab shows an error but I am not sure why. Does anyone knows why?

Best Answer

You cannot capture elements of array on the lhs directly to variables, you have to split it:
x = inv([ab ab_cd -cd])*[C-A];
betta = x(1); % beta is better me think
delta = x(2);
gamma = x(3);