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

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

[Octave-bug-tracker] [bug #58677] Error when using += operator


From: Joaquín
Subject: [Octave-bug-tracker] [bug #58677] Error when using += operator
Date: Mon, 29 Jun 2020 11:47:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

URL:
  <https://savannah.gnu.org/bugs/?58677>

                 Summary: Error when using += operator
                 Project: GNU Octave
            Submitted by: joaran
            Submitted on: Mon 29 Jun 2020 03:47:37 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: Joaquin
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I'm trying to add a vector to another vector by using the += operator. Octave
somehow gets confused with the sizes and throws an error:


error: p(_,112): but p has size 80x1
error: called from
    momentumEqStaggered at line 33 column 1
    ignit_Lucch at line 223 column 5


As can be noticed, the error pops up in a file named "momentumEqStaggered.m",
called from "ignit_Lucch.m".

Curious things are the following:

- Changing "p += pp" by "p = p + pp" solves the problem.

- The next line in the code is a similar operation, using +=, but this one
works fine:

rho += pp.*M/8314./T;


- When defining the necessary vectors in "momentumEqStaggered.m" and calling
directly to this script, the troubling line works just fine using the +=
operator!

I attach the two mentioned files in which the error shows, along with the file
with the added vectors where the line is executed without an error.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 29 Jun 2020 03:47:37 PM UTC  Name: ignit_Lucch.m  Size: 8KiB   By:
joaran

<http://savannah.gnu.org/bugs/download.php?file_id=49386>
-------------------------------------------------------
Date: Mon 29 Jun 2020 03:47:37 PM UTC  Name: workingEquation.m  Size: 1KiB  
By: joaran

<http://savannah.gnu.org/bugs/download.php?file_id=49387>
-------------------------------------------------------
Date: Mon 29 Jun 2020 03:47:37 PM UTC  Name: momentumEqStaggered.m  Size: 979B
  By: joaran

<http://savannah.gnu.org/bugs/download.php?file_id=49388>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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