The error I got initially was due to your not having two input arguments in your ODE function. It’s also best to not put your ODE solver call inside your ODE function. This can create recursion problems.
This works for me:
func = @(t,y) 0.594689181*(1/(0.594689181)^2+(0.298222773)^4/4*(1/t)+(0.127125232)^2+4*(0.357907906)^2*t^2+9*(0.291984971)^2*t^4+16*(0.105174606)^2*t^6-(0.298222773)*(0.127125232)*1/(sqrt(t))-2*(0.298222773)*(0.357907906)*sqrt(t)+3*(0.298222773)*(0.291984971)*t*sqrt(t)-4*(0.298222773)*(0.105174606)*sqrt(t)*t^2+4*(0.127125232)*(0.357907906)*t-6*(0.127125232)*(0.291984971)*t^2+8*(0.127125232)*(0.105174606)*t^3-12*(0.357907906)*(0.291984971)*t^3+16*(0.357907906)*(0.105174606)*t^4-24*(0.291984971)*(0.105174606)*t^5)^0.5;
[xsolv, tsolv] = ode45(func,[0.1:0.001:1.02], 0.12523);
I created ‘func’ as an anonymous function, and added the second argument (that must be in the function definition even if you don’t use it).