How to set assumptions in matlab

In summary, to set assumptions in Matlab, you can use the assume function to specify a logical expression for all subsequent calculations in the current session. These assumptions can be modified using the assumeAlso and assumeNot functions, and can be viewed using the assumptions function. The purpose of setting assumptions is to improve the accuracy and efficiency of computations and handle special cases, but there are limitations such as not being able to set assumptions for already assigned variables and certain types of functions.
  • #1
sara_87
763
0

Homework Statement



I want to know how to set assumptions in Matlab. i want to integrate 3*a*x/b but i want to tell MATLAB that b is less than a.

Homework Equations





The Attempt at a Solution



I know how to set assumptions that a variable is real/nonreal/positive/negative.
eg: sym('a','positive')
but not specific assumptions as b<a.

Thank you in advance.
 
Physics news on Phys.org
  • #2

Related to How to set assumptions in matlab

1. How do I set assumptions in Matlab?

To set assumptions in Matlab, you can use the assume function. This function takes in a logical expression as its input, and sets it as an assumption for all subsequent calculations in the current session.

2. Can I change the assumptions I have set in Matlab?

Yes, you can use the assumeAlso function to add additional assumptions or the assumeNot function to remove existing assumptions. These functions work the same way as the assume function, but allow you to modify the assumptions instead of overwriting them.

3. How can I view the assumptions I have set in Matlab?

You can use the assumptions function to view the current assumptions in Matlab. This will return a list of all the assumptions that have been set in the current session.

4. What is the purpose of setting assumptions in Matlab?

Setting assumptions in Matlab allows you to specify certain conditions or constraints for your calculations. This can help improve the accuracy and efficiency of your computations, as well as provide a way to handle special cases or edge scenarios.

5. Are there any limitations to setting assumptions in Matlab?

Yes, there are a few limitations to keep in mind when setting assumptions in Matlab. These include not being able to set assumptions for variables that have already been assigned a value, and not being able to set assumptions for certain types of functions (e.g. symbolic functions).

Similar threads

Replies
1
Views
610
Replies
20
Views
2K
Replies
10
Views
2K
Replies
3
Views
1K
Replies
1
Views
1K
Replies
1
Views
2K
Back
Top