Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-2921

Arrays are corrupted when passed to MATLAB function

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: R2012a
    • Fix Version/s: R2013a
    • Component/s: MATLAB Interface
    • Labels:
      None
    • Environment:

      Windows 7 Enterprise 64-bit
      2012-07-10 build

      Description

      The attached script calls passthrough.m and tries to pass an array to MATLAB and back.

      While passing from GMAT to MATLAB, the array is corrupted. For example, this array (in GMAT):

      11 12                  
      21 22                  
      31 32
      

      becomes this array (in MATLAB):

      11 22                  
      12 31                  
      21 32
      

      Passing from MATLAB back to GMAT seems to retain the structure of the array as it was on the MATLAB side.

        Gliffy Diagrams

          Attachments

            Activity

            Repository Revision Date User Message
            GMAT SourceForge Repository #10981 Mon Oct 15 20:36:12 UTC 2012 lindajun Fix for GMT-2921 Arrays are corrupted when passed to MATLAB function

            Updated to handle matrix of row-major order (C++) and column-major order (MATLAB) when putting/getting one-dimensional array to/from MATLAB.
            Files Changed
            MODIFY /trunk/plugins/MatlabInterfacePlugin/src/base/interface/MatlabInterface.cpp
            MODIFY /trunk/plugins/MatlabInterfacePlugin/src/base/command/CallMatlabFunction.cpp

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 5 minutes
                  2h 5m