"Second argument must be of form 'x' or 'x = a..b'." with fcontour
2 views (last 30 days)
Show older comments
Hello everyone,
I have an equation to integrate with Symbolic tools that works just fine until I have to plot its contour(fsurface works correctly). I get the message "Second argument must be of form 'x' or 'x = a..b'."
It is weird because I have other equations in the same code that are also plotted correctly with fcontour. I investigated and concluded that problem occurs because a step in my equation.
I have Syms T x y u and my equation contains the following part: T = int(u*(exp(x+y/u)), integration only in u....if I remove the u from the exponential part, then fcontour works,(T = int(u*(exp(x+y)) but of course with the wrong equation. Any idea why it happens?
This picture is the fsurface of the fucntion that is returning me this error with fcontour.
thhose two are from the modified equation that works
2 Comments
Matt J
on 17 Apr 2023
I get the message "Second argument must be of form 'x' or 'x = a..b'."
From what code?
Answers (1)
Praveen Reddy
on 11 May 2023
Edited: Praveen Reddy
on 11 May 2023
Hi Mateus,
I understand that you are trying to plot contour using “fcontour” function and encountering the error message "Second argument must be of form 'x' or 'x = a..b' ”.The "fcontour(f,xyinterval)" function expects “f” to be a function handle. I could observe that you are using symbolic expression instead of function handle. I suggest you to convert the symbolic expression to function handle while passing it to “fcontour” function as shown below using “matlabFunction”.
syms tau x y u
tau = 500000*int((sqrt(u)*(u+0.5))^-1*(exp(-(x^2 + y.^2)/(4*(0.5 + u)))),u,0,10)
figure
fcontour(matlabFunction(tau), [-25 0 -25 25])
To know more about “matlabFunction” and input arguments to “fcontour”, please refer the following MATLAB documentation:
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!