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

조회 수: 1 (최근 30일)
Gabriel S
Gabriel S 2020년 3월 4일
편집: Cam Salzberger 2020년 3월 4일
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
Cam Salzberger
Cam Salzberger 2020년 3월 4일
편집: Cam Salzberger 2020년 3월 4일
Are you trying to solve this system of equations symbolically or numerically? If symbolically, do you have the Symbolic Math Toolbox (check ver output).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by