Why its showing this error?

for 1st you I equations I gave coding it accepted
and when I code the third one
it told me this Error using symfun/assume (line 12)
Assumptions on symbolic functions not supported. Make assumptions on symbolic variables and expressions instead
can anyone help me to figure this out why

1 Comment

Please provide the whole code and the complete error message you get.

Sign in to comment.

 Accepted Answer

It is not permitted to use
syms S_1(x) positive %or negative or real or any other flag
assume(S_1, 'positive') %or any other flag
assume(S_1 > 0) %or any other condition
Note that if you used
assume(S_1(x), 'positive') %or any other flag
assume(S_1(x) > 0) %or any other condition
then those would be permitted. S_1 in this context is a symfun, but S_1(x) is the result of invoking S_1 upon x, and so is a symbolic expression rather than a symfun.

4 Comments

Bro why we are using those those % comments is those comments play a maojr role.
The % comments play the major roll of documenting that the issue is not the flag positive alone, and that the same problem occurs for each of the documented symbolic flags.
The known flags are
  • real
  • positive
  • integer
  • rational
You cannot use any of those in connection with declaring a function with syms
All of the following are wrong
  • syms f(x) real
  • syms f(x) positive
  • syms f(x) integer
  • syms f(x) rational
Thanks bro I learned this from you.

Sign in to comment.

More Answers (0)

Products

Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!