## Solving for two uknown vectors in a matrix equation

on 2 Apr 2019

### Torsten (view profile)

on 2 Apr 2019
So I have a matrix A (which is given) and its nullspace is 5x3 and its row space is 5x2,
so the basis of the nullspace and the basis of the row space will form a basis for R^5 and I want to calculate the values for two vectors such that these two basises form a vector that I have.
I.e I want to solve Where N is the vectors that form a base for my nullspace and R is the vectors that form a base for my rowspace, and are my uknowns and so to calculate this in matlab I tried the following:
A = [...] %too lazy to type it out as it's quite big
N = null(sym(A)); %5x2 matrix
R = colspace(sym(A')); %5x3 matrix
x = [1 2 3 4 5]';
syms t s %my unknowns
[t, s] = solve(N*t+R*s == x, t, s)
but whatever I do, I either get that my array sizes doesn't match. Which doesn't make sense to me because the dimensions of t should be 2x1 and the dimensions of s should be 3x1, or it tells me something about that my vectors aren't symbolic which makes even less sense.
I don't specify the dimensions anywhere for t and s which I guess could be a problem, but I didn't find a way of doing this unless I also filled them with elements which is not what I want to do.
Anyways, I'd really appreciate any help I can get.

R2019a