![]() To avoid this, we can pass an addition argument to mupadmex: syms f(x,y)įirst_d = mupadmex( 'symobj::jacobian',char(f),char(), 0) ![]() We actually don't want want the output to be converted back to a symbolic function. You'll notice that that the first_d output above is symfun class. The undocumented mupadmex function is a direct way of calling MuPAD function from within Matlab – there are others, which are documented.Ģ. To call this yourself, you can do (this also assumes you know your variables are x and y): syms f(x,y)įirst_d = mupadmex( 'symobj::jacobian',char(f),char()) This calls the low level 'symobj::jacobian' function and passes in string versions of the function and variables. Much of what you see may be confusing, but you should see this line: res = mupadmex( 'symobj::jacobian',Fsym.s,v.s) In the case of your jacobian function example, type edit jacobian in your command window to view the code in the Editor. ![]() The first thing to do is investigate how a particular symbolic math function is handling input and output and what lower level private functions it is calling. You want to avoid unnecessary conversions between strings and the sym/ symfun types.ġ. Doing this more directly and and adding in you own knowledge of the problem can help speed things up. Which also defines x and y as symbolic variables.Īs I mention in my comments above, Matlab/MuPAD's symbolic math is all about manipulating strings. Users on different versions may need to do slightly different things to achieve the results below, which relies on accessing undocumented functionality.įirst, since this is about performance, it is sufficient to simply declare syms f(x,y) ![]() Symbolic Math functionality has changed greatly in recent versions and continues to do so. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |