octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Octave-bug-tracker] [bug #64538] 1/x calculates wrong when mapped o


From: Volkmar Betz
Subject: Re: [Octave-bug-tracker] [bug #64538] 1/x calculates wrong when mapped on an array of floats
Date: Thu, 10 Aug 2023 07:21:24 -0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

Yes that works, Thank you!
Ja, das funktioniert, Danke😉


Am 10.08.2023 um 08:42 schrieb Markus Mützel:
Update of bug #64538 (project octave):

                   Status:                    None => Need Info

     _______________________________________________________

Follow-up Comment #1:

The `/` is a matrix division operator (shorthand for `mrdivide`). For a matrix
division to be possible the respective dimension of the two operands must
match.

I don't know if I understood correctly which result you consider to be wrong.
But maybe you intended to use an element-wise division? For that, you could
use the `./` operator (shorthand for `rdivide`):

1./[1.0,0.1]
ans =

     1   10

1./[0.1,0.2,0.3]
ans =

    10.0000    5.0000    3.3333

1./[0.1,0.2,0.3]'
ans =

    10.0000
     5.0000
     3.3333

1.0./[0.1,0.2,0.3]'
ans =

    10.0000
     5.0000
     3.3333

1.0./([0.1,0.2,0.3]')
ans =

    10.0000
     5.0000
     3.3333




     _______________________________________________________

Reply to this item at:

   <https://savannah.gnu.org/bugs/?64538>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]