bugGNU Octave - Bugs: bug #58093, Multiplication of Vector Functions

 
 

bug #58093: Multiplication of Vector Functions

Submitter:  keith Nahm <kb9nahm>
Submitted:  Wed 01 Apr 2020 02:34:11 AM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  3 - Low Item Group:  Unexpected Error or Warning
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Keith Nahm Open/Closed:  * Closed
Release:  * 5.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 01 Apr 2020 04:05:29 AM UTC, comment #2: 

If you type in the correct Matlab code in Octave using ".*", both Octave and Matlab deliver the same result.  You

The correct code using element-wise operations of the screenshots is:


x = 0:0.1:0.5;
y = 3*(1-x).^2.*exp(-x.^2)


If you want to compute a dot product, following the rules of linear-algebra and vector multiplication, use either of


x = 0:0.1:0.5;
y1 = 3*(1-x).^2;
y2 = exp(-x.^2);
y = dot (y1, y2)
y = sum (y1 .* y2)
y = y1 * y2'


in Octave or Matlab.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 01 Apr 2020 02:55:46 AM UTC, comment #1: 

do you want each element multiplied by its corresponding element.
or do you wand true vector multiplication with an answer of one number?

Doug Stewart <dastew>
Wed 01 Apr 2020 02:34:11 AM UTC, original submission:  


Trying to multiply two separate functions.

Each function works fine with variables entered as "x."

When those two are multiplied, it bounces with error messages.

Please refer to the attached files.
The first is the Matlab, and the second Octave.

Regards

Keith

keith Nahm <kb9nahm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48722:  matlab@shot.JPG added by kb9nahm (47KiB - image/jpeg)
file #48723:  Octave@Shot.JPG added by kb9nahm (73KiB - image/jpeg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by kb9nahm (Submitted the item)
  • -email is unavailable- added by kb9nahm
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-04-01 siko1056 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Item GroupMatlab Compatibility Unexpected Error or Warning
        StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2020-04-01 kb9nahm Attached File- Added matlab@shot.JPG, #48722
        Attached File- Added Octave@Shot.JPG, #48723
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code