MATLAB: How to keep an universal variable input and get intersection values from several different nonlinear equations together

intersection valuesnonlinear equationssolve equation

I was trying to solve and get intersection values from nonlinear equations. As below, basically, there are several nonlinear equations with including a same constant variable "268623".
clc
x9=solve('630957*(sqrt(x9/2)*(1-1/0.41*sqrt(x9/2)))-268623=0','x9')
x10=solve('794328*(sqrt(x10/2)*(1-1/0.41*sqrt(x10/2)))-268623=0','x10')
x11=solve('1000000*(sqrt(x11/2)*(1-1/0.41*sqrt(x11/2)))-268623=0','x11')
x12=solve('1258925*(sqrt(x12/2)*(1-1/0.41*sqrt(x12/2)))-268623=0','x12')
x13=solve('1584893*(sqrt(x13/2)*(1-1/0.41*sqrt(x13/2)))-268623=0','x13')
x14=solve('1995262*(sqrt(x14/2)*(1-1/0.41*sqrt(x14/2)))-268623=0','x14')
x15=solve('2511886*(sqrt(x15/2)*(1-1/0.41*sqrt(x15/2)))-268623=0','x15')
I attempted to create an input variable "n" to represent this constant. One of the example is as below:
clc
n=268623
x9=solve('630957*(sqrt(x9/2)*(1-1/0.41*sqrt(x9/2)))-n=0','x9','n')
however the return results are:
n =
268623
Warning: Cannot solve symbolically. Returning a numeric approximation instead. > In solve (line 305) In Flat_plate_drag_curve (line 5)
x9 =
x9: [1x1 sym]
n: [1x1 sym]
So, is there any straightforward way to have intersection values from these nonlinear equations within an input control.

Best Answer

syms x9 x10 x11 x12 x13 x14 x15 n
clc
n=input('Enter the value for n\n');
x9=vpasolve(630957*(sqrt(x9/2)*(1-1/0.41*sqrt(x9/2)))-n==0)
x10=vpasolve(794328*(sqrt(x10/2)*(1-1/0.41*sqrt(x10/2)))-n==0)
x11=vpasolve(1000000*(sqrt(x11/2)*(1-1/0.41*sqrt(x11/2)))-n==0)
x12=vpasolve(1258925*(sqrt(x12/2)*(1-1/0.41*sqrt(x12/2)))-n==0)
x13=vpasolve(1584893*(sqrt(x13/2)*(1-1/0.41*sqrt(x13/2)))-n==0)
x14=vpasolve(1995262*(sqrt(x14/2)*(1-1/0.41*sqrt(x14/2)))-n==0)
x15=vpasolve(2511886*(sqrt(x15/2)*(1-1/0.41*sqrt(x15/2)))-n==0)
Use the code above. Note that you try to insert the variable n after you solved the equations. To do so, you have to use subs command. In this way, you define n however you wish and the solutions are obtained.