is it possible to substitute multiplication and division by addition and subtraction respectively in MATLAB?

조회 수: 1 (최근 30일)
is it possible to substitute multiplication and division by addition and subtraction respectively in MATLAB?

답변 (1개)

Steven Lord
Steven Lord 2017년 10월 18일
Of course. Instead of typing:
x = 3*5;
type:
x = 3+5;
If that's not what you meant, explain in more detail what you want to do and we can suggest whether or not it's possible.
  댓글 수: 4
Steven Lord
Steven Lord 2017년 10월 22일
Sure.
x1 = 3*5;
x2 = 3+3+3+3+3;
Now I suspect doing this manual substitution is not what you have in mind or what you're being asked or told to do. Why don't you tell us the problem you're trying to solve and what constraints or requirements you have and we may be able to offer suggestions.
Walter Roberson
Walter Roberson 2017년 10월 22일
For example if this is a string manipulation question then it becomes a bit easier... provided that you do not have to deal with nested brackets.

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

Community Treasure Hunt

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

Start Hunting!

Translated by