MATLAB Answers

what's a externally defined MCOS class ?

98 views (last 30 days)
loubna ibnou fairouze
loubna ibnou fairouze on 6 Dec 2019
Answered: Zhenwei Sun on 29 Jan 2021
Hello all,
I am getting this error while runing a test on testManager 'You must remove the externally defined MCOS class before you can use the dictionary definition'. I don't know what are MCOS class, and how do I remove one ?
Best regards.

Answers (6)

Jin-seok Jeong
Jin-seok Jeong on 29 Feb 2020
Edited: Jin-seok Jeong on 29 Feb 2020
I have the same problem.
In my case, the error was due to the enumerated type defined in data dictionary.
But there was no problem in 2018b.
I have no idea why the mcos class error occurs in 2019b.
  1 Comment
Sean de Wolski
Sean de Wolski on 2 Mar 2020
Please contact tech support. This is a public forum.

Sign in to comment.

Brian Kim
Brian Kim on 27 Mar 2020
The root cause of this message is most likely that the enumeration is first defined programmatically (e.g. 'Simulink.defineIntEnumType') and Simulink then attempts to redefine it when loading a model linked to a data dictionary which contains a second enumeration definition.
In order to prevent these issues, you may wish to employ the following commands:
>> Simulink.clearIntEnumType
This will clear enum definitions created by the "Simulink.defineIntEnumType" command.
This will close connections to data dictionaries that are presently open. If a data dictionary contains an enum definition, closing the dictionary will attempt to release this enum definition from memory.
For additional information related to these functions please reference the following documentation pages:
  1 Comment
Gokul on 25 May 2020
I tried the function "Simulink.clearIntEnumType" on R2019b, to get rid of this MCOS error. But it seems to be unable to remove and gives the following Warning:
>> Simulink.clearIntEnumType
Warning: Cannot clear class 'AStype' because instances of the class still exist.
Could you suggest how can I clear this, without closing and restarting Matlab?
Note: The data dictionary/models are all already closed

Sign in to comment.

Samir Revelo
Samir Revelo on 20 Jan 2020
I´m getting the same error after upgrading my Simulink project from matlab version r2018b to r2019b.
Would be very helpful if Matlab support can give any hint about the issue.

Sean de Wolski
Sean de Wolski on 10 Feb 2020
I'd contact tech support on that one.

Oleksandr Pylypenko
Oleksandr Pylypenko on 23 Mar 2020
I get this error when moved all model data(with enum) to data dictionary, but in the matlab memory that define was saved. In the end I had two definition of enum. In order to delete enum from matlab memory run this command: Simulink.clearIntEnumType()

Zhenwei Sun
Zhenwei Sun on 29 Jan 2021
i get this issue in 2019a,Would be very helpful anyone have fix this?

Community Treasure Hunt

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

Start Hunting!