Home MATLAB: fsolve error " not enough input arguments"
Reply: 0

MATLAB: fsolve error " not enough input arguments"

user781
1#
user781 Published in May 27, 2018, 3:35 am

I have a simple code to solve 3 nonlinear equations. below is my code. I am pretty sure about it but I keep getting this error: "em1" requires more input arguments to run.

this is em1.m:

function F = em1(x)

m0=12.56e-7;
e0=8.85e-12;

md=m0;
ed=2.56*e0;

b=1.016e-2;
h=b/3;

f=12*(10^9);

F(1) = (x(1)/m0)*cot(x(1)*(b-h))+(x(2)/md)*cot(x(2)*h);
F(2) = x(3)-((((2*pi*f)^2)*m0*e0)-(x(1))^2)^(1/2);
F(3) = x(3)-((((2*pi*f)^2)*md*ed)-(x(2))^2)^(1/2);

and here is my mainem1.m file:

fun = @em1;
x0 = [100,100,5];
x = fsolve(fun,x0)

I am sure that the error is not because of "the number of inputs" but what is it???? I can not seem to find the solution. please help me run my code. thank you

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308747 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO