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

3 views (last 30 days)
tina jain on 18 Oct 2017
Commented: Walter Roberson on 22 Oct 2017
is it possible to substitute multiplication and division by addition and subtraction respectively in MATLAB?
Walter Roberson on 18 Oct 2017
The quantities being manipulated, are they known to be positive?

Steven Lord on 18 Oct 2017
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.
Steven Lord on 22 Oct 2017
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 on 22 Oct 2017
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.