1.(adsbygoogle = window.adsbygoogle || []).push({});

a line in my code is something like

int(phi*x^2,0,2)

where i want phi to be a function which the user

has choosen. But how can i let the user choose a function? For numbers you can use input but how to do

it with a function?

2.

i want to solve a nonlinear system of equations in x,y.

exp(-2x)*(2*r*x-1)+1=8*pi*r^2 (1)

exp(-2x)*(2*r*y+1)-1=8*pi*r^2

Do you have to specify r before you solve the system or can you get a solution as function of r,

x=f(r) (2)

y=g(r)

?

x and y are parameters in a spherical symmetric metric and r are the radius so i guess you need a solution like (2)? But is that possible in matlab? Do you need to solve the system for many different r's and then plot the x and y as a function a r?

Thank you.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab questions

**Physics Forums | Science Articles, Homework Help, Discussion**