Is there a smart way to do this? Because I can't find any in the documentation.
Let's say I have something like
a = 1:10
b = 4
Multiplication works great, either
a*b
or
b*a
returns
[4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
but with divison and power I have some issues, what is in my mind is something like
b/a (or b./a)
to act something like this
(b*ones(size(a)))./a
is there a smarter way to do this than replacing every number in the string with number*ones(..)?
Is there a smart way to do this? Because I can't find any in the documentation.
Let's say I have something like
a = 1:10b = 4Multiplication works great, either
a*bor
b*areturns
[4, 8, 12, 16, 20, 24, 28, 32, 36, 40]but with divison and power I have some issues, what is in my mind is something like
b/a (or b./a)to act something like this
(b*ones(size(a)))./ais there a smarter way to do this than replacing every number in the string with number*ones(..)?