Is it possible to create a function to shorten a variable?

7 Ansichten (letzte 30 Tage)
Gabriel S
Gabriel S am 4 Mär. 2020
Bearbeitet: Cam Salzberger am 4 Mär. 2020
Hello.
I would like to know it is possible to create a function ("b" in the example below) in order to shorten the expression of another variable. For example:
a = 2;
b = 0.5*c + 1;
c = b + a;
Solving the system of equations above manually, a value of c = 6 and b = 4 is achieved. That being said, is there a command that lets me reproduce this manual calculation, or do I have to obligatorily replace "c = b + a" with "c = 2*(a+1)" in order to solve this system? Thanks in advance!
  1 Kommentar
Cam Salzberger
Cam Salzberger am 4 Mär. 2020
Bearbeitet: Cam Salzberger am 4 Mär. 2020
Are you trying to solve this system of equations symbolically or numerically? If symbolically, do you have the Symbolic Math Toolbox (check ver output).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by