# Importing data from Matlab, using data in “NSolve” and send the results back to Matlab

I have generated an image processing code in Matlab. It has several subroutines and in one of them, I should solve a system of 7 nonlinear equations. I use "fsolve" in Matlab to solve this system, however, it gives me only one local optimum (answer) while using "Nsolve" in Mathematica, I can get all the possible answers. That's why I decided to solve my equations with Nsolve. Would you please let me know how should I import this equation from Matlab to Mathematica and export the results to Matlab after solving? (Belo is the code I used for Nsolve)

M = {{α1, β3, β2}, {β3, α2, β1}, {β2, β1, α3}};

Timing[
sol2 = NSolve[{
β1 - (β2 β3 )/α1 == 2/3,
α2 - (β3 β3)/α1 == 2/3,
α3 - (β2 β2)/α1 == 8/3,
α1 - (β2 β2)/α3 == 8/3,
α2 - (β1 β1)/α3 == 2/3,
β3 - (β1 β2)/α3 == 2/3,
(4/3*Pi)^2 == 2.094^2*(CharacteristicPolynomial[M, x] /. x -> 0)}, {α1, α2, α3, β1, β2, β3}]


Right Hand Side (RHS) values in the above system (2/3, 2/3, 8/3,...) are being calculated in a subroutine in Matlab and are known here and matrix M should be calculated by NSolve. Therefore, my question is that which command should I use in Matlab to import RHS values to Mathematica (to use in the above code) AND after solving, how can I export "M" to Matlab? Thanks,

The magic words are MATlink, which can be found on matlink.org