Different behavior of ./ and .* with vectors [SOLVED]
|
05-02-2017, 09:11 PM
(This post was last modified: 05-03-2017 06:39 PM by compsystems.)
Post: #4
|
|||
|
|||
RE: Different behavior of ./ and .* with vectors
the Hadamard operations (Hadamard Product .*, Hadamard Power .^, Hadamard Inverse .^-1 and Division ./ ) are Element by Element
https://en.wikipedia.org/wiki/Hadamard_p...(matrices) the two arguments must be an array although the math kernel can expand functionality with scalars array vs matrix(linear algebra) operations https://www.mathworks.com/help/matlab/ma...tions.html HP50 & HPPRIME CAS MODE hadamard([[1,2],[3,4]],[[3,4],[5,6]]) RETURNS [[3,8],[15,24]] // OK HP50 hadamard([1,2],[3,4]) RETURNS [3,8] // ok hadamard([[1,2]],[[3,4]]) RETURNS [[3,8]] // ok HPPRIME CAS MODE hadamard([1,2],[3,4]) RETURNS 5*√5 WHY? hadamard([[1,2]],[[3,4]]) RETURNS [[3,8]] [1,2] .* [3,4] RETURNS [3,8] 4 ./ [2,4] -> [2,1] [4] ./ [2,4] -> [2] /!\ Resize to a smaller size [2,4] ./ [4] -> [1/2] 4 .* ([2,4] .^ -1) -> [2,1] 4./[2,4] -> 4.0 / [2,4] -> 4./[2,4] ? Without spaces also should operate to each element, as some point operations are equivalent to natural operators like [+] [-] [/] |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Different behavior of ./ and .* with vectors [SOLVED] - JMB - 04-29-2017, 04:22 PM
RE: Different behavior of ./ and .* with vectors - Tim Wessman - 05-01-2017, 04:19 PM
RE: Different behavior of ./ and .* with vectors - JMB - 05-01-2017, 05:34 PM
RE: Different behavior of ./ and .* with vectors - compsystems - 05-02-2017 09:11 PM
RE: Different behavior of ./ and .* with vectors - JMB - 02-02-2018, 08:44 PM
|
User(s) browsing this thread: 3 Guest(s)