Error in 2018a: External converter methods for package-qualified classes not supported

5 ビュー (過去 30 日間)
JFz
JFz 2018 年 5 月 15 日
コメント済み: JFz 2018 年 6 月 27 日
Hi,
My code (running perfectly in 2016a) cannot run in 2018a due to an error: External converter methods for package-qualified classes not supported The code looks like this: hr = P.pHR(a, b, c);
How to correct this to fit into 2018a? Or better, how to make my code backward compatible? Thanks,
  1 件のコメント
JFz
JFz 2018 年 5 月 16 日
Matlab states that: "You cannot define a converter method that uses dots in the name in a separate file. Define package-class converters in the classdef file."
Is there a sample code for that? Thanks

サインインしてコメントする。

採用された回答

Aljen
Aljen 2018 年 6 月 27 日
Hello JFz,
I just had this same problem, and when looking a bit better at my code, i found the problem.
For me, the line that was pointed to in the error message was a method definition line in a class definition file. The problem here is that the definition is specified like a method-call, instead of a method-definition. Assuming this is a non-static method, the first input argument will be an object of the class. In the definition, this now is required to be specified as an input argument. (Previously, apparently, we were allowed to put this first first argument before the method name, even in the definition).
TLDR:
If you change
hr = P.pHR(a, b, c);
to
hr = pHR(P, a, b, c);
it will probably work, also in previous releases.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by