MATLAB AMPL API - java ClassCastException Error (D cannot be cast to [Ljava.lang.Object;)

1 view (last 30 days)
I am using MATLAB AMPL API and i am trying to create a dataframe to assign values to AMPL.
Here is how i use dataframe and the error that i get
where
  • U is a 48x4 double,
  • T is a 48x1 double
  • A is a 4x1 double
The issue is, that when the same code is run in another computer with R2015 version, no errors are produced. I use R2020b version. I am not sure if this has to do anything with the issue but just mentioning it. Anyone can shed a light here?

Answers (1)

Dinesh
Dinesh on 1 Feb 2024
Hi Nick,
The error you're encountering with the MATLAB AMPL API is most likely due to changes in the API itself or differences in how MATLAB versions handle Java objects and interactions with external libraries. To resolve this, ensure that you're using the correct version of the AMPL API compatible with MATLAB R2020b and check the AMPL API documentation for any updates or changes in the syntax for creating dataframes between versions.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!