Skip to content

Pointwise operations between scalar and vector #707

Description

@SimoneTosato

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(..)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions