Passing fuel tank information to matlab

MATLAB-specific help discussions.

Passing fuel tank information to matlab

Postby jem » Mon Oct 19, 2009 7:35 pm

When I try to create a function interface to pass fuel tank information to a MATLAB function (as an input argument), I see no object (in the GUI selector) called 'FuelTank<n>', even though I created two tanks under the Hardware tab.

Nor do I see anything related to this under DefaultSC, even though I assigned both tanks to the DefaultSC.

I have tried several things through the scripts including:

function foo(FuelTank1)
Tank_temp = FuelTank1.Temperature;
end

And:
function foo(DefaultSC)
Tank_temp = DefaultSC.FuelTank1.Temperature;
end

Both of these examples throw very cryptic exceptions.

Any help you can give me would be appreciated. I can always pass these through a parameter file using the reporting interface, but I would prefer to use the argument/object interface if possible.

Cheers,

Jeff
jem
 
Posts: 3
Joined: Mon Jul 13, 2009 8:58 pm

Re: Passing fuel tank information to matlab

Postby space_egd » Wed Oct 21, 2009 5:22 pm

Hello Jeff,

I'm assuming you have access to the developmental build of GMAT or are compile GMAT based off of the latest code.

The ability to report out the parameters of an attached spacecraft object were implemented into GMAT this month. Before that there was no way for a user to retrieve the values of parameters for those attached tanks.

The following GMAT Function code you mentioned now works in the latest version of GMAT (I'm using it now):
Code: Select all
function foo(DefaultSC)
Tank_temp = DefaultSC.FuelTank1.Temperature;
end


In order to use the value of Tank_temp in Matlab, you have to pass that variable to matlab. Currently like you mentioned, simply passing the Spacecraft into matlab won't include the information you want.

Please feel free to submit a bug, describing how you would like the passing of a Tank or Spacecraft to Matlab to appear in the Matlab workspace. We have been thinking about this but just haven't had time to implement it.
space_egd
 
Posts: 357
Joined: Sun Jun 08, 2008 9:02 pm
Location: MD


Return to MATLAB Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron