How to use symbolic expression with matlab coder
Show older comments
I have a symbolic expression that I would like to integrate using a mex file. I know how to do the integration the following way:
function f=test_fun(x)
f=x.^2;
end
^This is the function I am integrating
function q=test_int(a,b)
q=quadgk(@test_fun,a,b);
end
^This is the call to integrate that function:
Using this I can successfully create a mex file.
My problem is that in my test_fun file, I would like to use a symbolic expression that I have loaded with load('') for f rather than explicitly typing the equation because it is way to long to type. I would like to do something like this if possible.
function f=test_fun(x)
load('f') %f is a symbolic expression of x
f=eval(f);
end
Is there a way to do this??
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance 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!