-1

I have a matlab function which uses fsolve built-in function. It works well on matlab side. When I try to run that matlab function in python using Oct2py, I face this error.

error

enter image description here Please help me with this error.

Thanks in advance.

Tienn
  • 9
  • 4
  • The error indicates that the way you've called `fsolve` is wrong somehow. Since you don't provide any code, there is not much more to say here. When other people use fsolve, typical errors include passing a 'call to a function' instead of a 'function handle'. (e.g. `fsolve ( myfun, x0 )` instead of `fsolve( @myfun, x0 )' ) – Tasos Papastylianou Feb 15 '22 at 09:28
  • Thanks for your reply. I added a code clip. – Tienn Feb 15 '22 at 13:53
  • Please post a [mre]. Also [please do not upload images of code/errors when asking a question.](//meta.stackoverflow.com/q/285551) Include it as a [formatted code block](/help/formatting) instead of an image. – Pranav Hosangadi Feb 15 '22 at 16:42

1 Answers1

0

Based on the code you provided, you are calling fsolve with 6 input arguments instead of the expected 3.

You say your code 'works' in matlab, but from the equivalent matlab documentation I don't see matlab being compatible with more than 3 arguments either. It is possible that your extra arguments simply get ignored in matlab. What are Xp, q, and in_param supposed to do?

Tasos Papastylianou
  • 21,371
  • 2
  • 28
  • 57