Quantcast comsol multiphysics; fzero and inline function with many parameters Text - Physics Forums Library

PDA

View Full Version : comsol multiphysics; fzero and inline function with many parameters


hadoque
Nov12-08, 08:14 AM
Hi
I'm trying to get comsol multiphysics to first define an inline
function with 1 variable and 4 parameters, and then run fzero on that
same function. I can do it with two parameters, but no moore.

This works:

clear
myfun=inline('exp(y).*cos(x)+z', 'x', 'y', 'z');
x1 = fzero(myfun,-5,2,1)

This does not work:

clear
myfun=inline('exp(y).*cos(x)+z+u', 'x', 'y', 'z', 'u');
x1 = fzero(myfun,-5,2,1,0.3)

C» test
Error: Too few arguments to inline function.


Would be thankful for any hints about this.


/Johan