GAMS-01 GAMS与MATLAB间的数据交互方法
生活随笔
收集整理的這篇文章主要介紹了
GAMS-01 GAMS与MATLAB间的数据交互方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
💡GAMS的安裝路徑可以在GAMS的選項卡中找到~
?正常返回的內容:
>> help wgdxWrite data into GDX file. It can take multiple input structures in onecall. It doesn't return any output. syntax: wgdx ('gdxFileName', s1, s2 ...);s1, s2, etc are Matlab structure. Valid fields for this structure are asfollows:1. name: String input for name of the symbol in gdx file. 2. val: Numeric data matrix of set or parameter to be written. It can be entered in either full or sparse format. 3. form: String input for form of output data matrix. Valid values are ('full'/'sparse').It is optional, with default as 'sparse'.4. type: String input indicating type of symbol.Valid values are (set/parameter).It is optional with default as 'set'.5. uels: This is 1*n cell array of uels to be used for filtered read. It is optional. Example {{1:5}{'i1', 'i2'}} for 2D 6. dim: Numeric value representing dimension of symbol.It is optional. 7. ts: Text string in string form.It is optional with default value as "MATLAB data from GDXMRW" >> help rgdxRead data from GDX file and store it in Matlab structure. syntax: x = rgdx ('gdxFileName', struct)'struct' is Matlab structure. Valid fields for this structure are as follows:1. name: String input for name of the symbol in gdx file. It is mandatory field2. form: String input for form of output data matrix. Valid values are ('full'/'sparse').It is optional, with default as 'sparse'3. compress: Boolean or String input. If it is set to be 'true' then output data matrix will not contain all zero rows and columns.Valid values are ('true'/'false').4. uels: This is 1*n cell array of uels to be used for filtered read. It is optional. Example {{1:5}{'i1', 'i2'}} for 2D 5. field: String input for field of variable or equationValid value are ('l'/'m'/'lo'/'up')It is optional with default as 'l' and can only be entered if symbol is either variable or equation. 6. ts: Boolean or String input for text string. If it is set to be'true' then output structure will contain one more field 'ts'containing text string of the symbol.It is optional with default as false7. te: Boolean or String input for text element. If it is set to be'true' then output structure will contain one more field 'te'containing text elements of the set in cell array form. It is optional with default as false. And can only beentered in case of 'set'Output structure 'x' will have the following fields1. name: Name of symbol in string form.2. type: Type of symbol in string form. Valid values are (set/parameter/variable/equation).3. val: Symbol numeric data matrix. It is N dimensional ifpresented in full format and 2 dimensional in case ofsparse.4. dim: Numeric, dimension of symbol.5. uels: Unique Element Listing of the data in cell array format. 6. form: String value representing the form in which data matrix of .val is presented. Valid values are (full/sparse).7. field: String value representing field of symbol.Only present in output structure if symbol is either variable or equation.8. ts: Text string in string form. Only present in output structure if indicated in input.9. te: Text elements in cell array form. Only present in output structure if indicated in input. >>總結
以上是生活随笔為你收集整理的GAMS-01 GAMS与MATLAB间的数据交互方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 实体类定义规则以及主要实体类详解
- 下一篇: MongoDB多表查询各属性详解