How to use an object property in a rogue function?
Show older comments
Hello, I want to define an object's property as an algebraic expression and use it as a private function in the integral method. This is how I tried:
syms x
r1 = reaction;
r1.rx=1./(k1*(1-x));
q1=integral(@(x)r1.rx,0,0.5)
However I get the following error:
Error using integralCalc/finalInputChecks (line 511)
Input function must return 'double' or 'single' values. Found 'sym'.
Everything works fine if I use the expression directly on the private function.
Accepted Answer
More Answers (0)
Categories
Find more on Assumptions 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!