سؤال

Is there any work around for using the "import" function when coverting a matlab *.m file to a C++ executable?

Matlab gives me this response: "Import statements are currently unsupported." and I just wanted to know if I was SOL or not.

Thanks

هل كانت مفيدة؟

المحلول

import makes Java classes available to Matlab programs. Since doing so makes it necessary to actually have a running Java Runtime Environment, I think it would be very costly to provide this functionality to generated C++ code – while it is always present when running the original m-file. I therefore would interpret the error message to say exactly what it says: "unsupported".


To be more precise and give references: MATLAB Language Features Supported for C/C++ Code Generation explicitly says that Java is not supported, but Matlab classes are. Moreover, import is not contained in the list of Functions Supported for C/C++ Code Generation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top