【问题标题】:Import Data in cplex from excel (xlsx file)从 excel(xlsx 文件)导入 cplex 中的数据
【发布时间】:2020-01-10 00:00:51
【问题描述】:

我有一个 excel 表,我想把这个表的一列放在 .dat 文件的向量中。 这是我所拥有的: 具有完整路径的第一个解决方案: SheetConnection sheet("C:\Users\Hor246\opl\Bushfire\month_01_omission.xlsx"); 来自 SheetRead(sheet,"month_01_omission!B2:B431"); 的值 名称为第二个解决方案: SheetConnection sheet("month_01.xlsx"); 纬度来自 SheetRead(sheet,"month_01!A2:A855856"); 在这两种情况下,当我运行项目时,cplex 都会说“未定义值/纬度” 你知道是什么问题吗? 谢谢

【问题讨论】:

    标签: excel cplex


    【解决方案1】:

    你应该在你的 .mod 中声明你的价值和纬度

    参见例如 CPLEX 中的油 example

    你有

    {string} Oils = ...;
    

    在 .mod 中,然后

    Oils from SheetRead(sheet,"'oil data'!A2:A4");
    

    在.dat中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多