You could also request that the function be updated to handle symbolic variables for the order of integration input. I'd recommend that you file a service request with The MathWorks to report this issue. In my opinion, sym/diff should throw an error if it has this limitation rather than returning garbage. MuPAD's related functions have similar limitations as well unfortunately. The order, n (or i in your code) is also limited to a scalar.
If you already have MATLAB installed, then you can click you can click Add-ons and search for the symbolic toolbox and install it. In other words, the function doesn't support symbolic variables to specify the order of integration. If you have the Symbolic toolbox, then you can download the MATLAB install it with the symbolic toolbox. Why does diff(f,x,i) evaluate to zero even though i is symbolic? From the documentation for sym/diff:ĭiff(S,n), for a positive integer n, differentiates S n times.ĭiff(S,'v',n) and diff(S,n,'v') are also acceptable. % Convert yi back to symfun so output is symfun % Calculate next derivative from previous Yi = % To index into array, yi cannot be symfun N = 0:2 % Increasing orders of differentiation Just use a for loop ( sym/diff is not vectorized in the third argument – see below): syms x y Īlternatively, you could try this form (in this case, for just three indexes, the above will probably be more efficient): syms x y When using symsum, you need to be aware that, like with any Matlab function, the input arguments will be evaluated before being passed in.
I'm not working on a student license either.This occurs because diff(f,x,i) evaluates to zero. I also realised that the documentation is always available when I take Help -> Product Help from the menu-bar, though it is not available in the function browser even after I try the sample code.ĮDIT-II > license('checkout','Symbolic_Toolbox') Warning: Explicit solution could not be found. I have the most recent version of the Maple version of the symbolic toolbox and when I put your expression into it I get. I'm not sure if this problem is just for this particular toolbox or not, but the other toolboxes I use at least seem to work fine. The version of MATLAB you are using uses MuPad as it's symbolic computation engine but they used to use Maple. Some of them seem to blame it on MATLAB hashing the tollbox incorrectly, so I tried the rehash toolbox command as well, but had no luck. I found a few instances of other users facing similar problems on the Mathworks portal, but none of them seemed to provide any concrete solutions. However, the problem again arises when I close and reopen MATLAB.
The code works fine and on trying the help command again, they seem to work fine as well. Moreover, when I try some simple code such as: > syms k x
However, the toolbox seems to be installed when I try the ver or pathtool command.
Type "help help" for help command options, such as help for methods. Use the Help browser Search tab to search the documentation, or Get suggestions for next steps in a symbolic workflow using MATLAB Live Editor. Create, run, and share symbolic math code using the toolbox. When I try to access any function in the 'Symbolic Math Toolbox' in MATLAB, such as help ztrans or help laplace, I get the following kind of message ztrans not found. Symbolic Math Toolbox provides functions for solving, plotting, and manipulating symbolic math equations. This problem may seem a bit weird please bear with me.