How to generate code for a class subclassing a built-in class?

Hi,
I'm trying to generate code for this example (class and test function in two separate .m-files):
%#codegen
classdef DocSimpleDouble < double
methods
function obj = DocSimpleDouble(data)
obj = obj@double(data); % initialize the base class portion
end
end
end
function r = test_doc
d = DocSimpleDouble(5);
e = DocSimpleDouble(6);
r = d + e;
Trying this
codegen -c -config:lib test_doc.m
I get this error message:
??? Base class 'double' cannot be loaded.
Error in ==> DocSimpleDouble Line: 4 Column: 7
Code generation failed: Open error report.
Error using codegen
I did not see anything in the docs that subclassing a built in class is not possible with code generation.
Any ideas?
Thank you!
Tilo

回答 (0 件)

この質問は閉じられています。

製品

質問済み:

2013 年 5 月 13 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by