When will people learn to use vectors instead of numbering their variables? And learn to use semicolons on your lines, in the right places. syms does not need a semicolon. Oh well, these will be eternal battles. :)
Others have said this. But it really is simple. If I have a LINEAR system of equations, set equal to zero, and there are NO constant terms. That is a system that is called a homogeneous linear system, then the solution of the problem (if the matrix A is of full rank)
A*X = 0
will be all zeros for the vector X. Can we write this system as a linear homogeneous system? Well yes, we can. Each of the subsequent equations are just derivatives of the first one for displacement. And it does not matter how many times you differentiate an expression like a1*sin(B*x), with respect to x. It will still be a1*(stuff). That is, it will still be linear with respect to the unknown a1. And there will be no constant terms created, that are NOT a function of a1.
By the way, these next 4 lines effectively do NOTHING at all in MATLAB.
Those results are dumped directly into the bit bucket. MATLAB looks at what you wrote, then said to itself, hmm. they want me to set something to zero, but then they do not tell me what to do with it, just display the result on the command line. So nothing substantial happens beyond displaying a result.
Had you written this:
eq11 = eq11==0
eq12 = eq12==0
eq13 = eq13==0
eq14 = eq14==0
That would actually have done something!
Anyway, we can write ALL of these equations in a simple form. I'll let MATLAB do it for me. And I'll do it correctly.
displacement1 = a1*sin(B*x)+a2*cos(B*x)+a3*sinh(B*x)+a4*cosh(B*x);
eq(1)=subs(moment1,x,0) == 0;
eq(2)=subs(shear1,x,0) == 0;
eq(3)=subs(displacement1,x,y) == 0;
eq(4)=subs(moment1,x,y) == 0;
As you can see, we now have 4 equations in the vector eq.
Do you see that your four equations are still a LINEAR system in the unknowns a1,a2,a3,a4? We can factor out those unknowns as a vector, [a1;a2;a3;a4].
Now let MATLAB do the work. equationsToMatrix does it for me.
[A,rhs] = equationsToMatrix(eq,[a1,a2,a3,a4])
As long as that linear system has rank 4, then NO solution exists except the all zero solution. See there are NO constants in this, so this really is what I called a homogeneous linear system. And the matrix A has full rank. MATLAB knows that.
NO solution to that linear system can exist but the one with a1=a2=a3=a4=0. I'm sorry, but that comes from Linear Algebra 101. (Ok, maybe Linear Algebra 102. It has been a really long time since I took those classes.)
Now we can solve the linear system. The answer should be absolutely no surprise.
X = solve(eq,[a1,a2,a3,a4])
Had you wanted to get a non-zero result, you had to put some sort of action into the system. (David points this out.) A load at some point perhaps, or a gravity load.