Syntax error in MATLAB recurrence equation

I looked here how to declare recurrence equations.

I tried the following example from this page:

>> solve(rec(y(n + 1) = 3*(n + 1)*y(n), y(n), {y(0) = 1})) | Error: The expression to the left of the equals sign is not a valid target for an assignment. 

Then I noticed that I did not have the Symbolic Math Toolbox installed. After installation

 >> ver 

returned (among some others):

 MATLAB Version 8.1 (R2013a) Symbolic Math Toolbox Version 5.10 (R2013a) 

but i still got the error above.

I could narrow the command down to the following by indicating the same error above:

 >> rec(y(n + 1) = y(n), y(n), {y(0) = 1}) | Error: The expression to the left of the equals sign is not a valid target for an assignment. 

On wikis and other Google results, an error is only mentioned with an error when starting = c == .

+4
source share
1 answer

rec not a native function of the Symbolic Toolbox. It belongs to MuPAD, which is a separate package that Mathworks purchased and added to the Symbolic Toolbox . To use it, you must first enter the mupad command in the command window, then enter the command that uses rec in the MuPAD window that appears.

+5
source

Source: https://habr.com/ru/post/1499785/


All Articles