It's just a quadratic. Re-arrange
ty + 5.310956420*10^6 * ty^2 ./ py.^2 - 298
into standard quadratic form and solve. (This does mean that you will get two values for each element of py)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!