S =
v1: [1x1 sym]
y: [1x1 sym]
There no v2 in the solution so S.v2 gives the error
If you want S.v2
syms s a b c d k
S = solve('y=v1*(c+d+a)-v2*c','c*(s*v1-s*v2)=b*s*v2+k*v2','v2','y');
S = [S.v2 /S.y]
Please note that the way you were defining the symbolic variables was working fine but could be simpler like in my code.
Also note that I added 'v2' and 'y' to the solve function, this way I'm telling that I want to get the solution for the v2 and y variables, if you don't specify the variables the solver will find them for you just like in your code, but it might not give what you wanted.
Best Answer