I have this problem that i would like to solve preferably in MATLAB
Solve:
$$\frac{d^2y}{dx^2} + \sin(y) = 0$$
with endpoint conditions $y(0) = 0$ and $y(0.5) = 0.2618$.
I think i have to plot the solution. I would appreciate any kind of help.
My incomplete solutions until now is:
a=0;b=10; %limits
h=0.00001; %step
N=round((b-a)/h)+1; %nodes
x=zeros(N,1);% init solution vectro
x(1)=0; %initial condition
% y(1) = 0.2618; - i still need the second condition
for i=2:N
x(i)=x(i-1)+h*y(i-1);
y(i)=y(i-1)- h * sin(x(i-1));
end
plot(a:h:b, x);
hold on;

So i search a bit more on the internet for a matlab solution and i found this great video http://blanchard.ep.wisc.edu/bvp4cflash/bvp4cflash.html
This really explains on the same kind of problem that i have. Following his examples I tried to adjust his code to my problem and i got this (im not sure 100% is corect - but at least it plots the same plot as Julian's)
exam1ode defines my ecuation
exam1bc defines the boundary conditions