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 64bit
20120710 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
 All
 Comments
 Work Log
 History
 Activity
 Subversion
The temporary workaround to this is to reshape your matrix into an array:
Create Array patchSTMs[7,36] out[56]; Create Variable I J Index; Create MatlabFunction yourMatlabFunction; Create String newRow; GMAT yourMatlabFunction.FunctionPath='the path to your m_file'; BeginMissionSequence % % fill in the contents of patchState array here % . % . % . newRow=' '; For I=1:1:8; For J = 1:1:7; Index = (I1)*7 + J; out(Index) = patchStates(I,J); EndFor EndFor GMAT [outMatlab] = yourMatlabFunction(out); Report r out; Report r newRow; Report r outMatlab;
then reshape back into a Matrix from your matlab script.