editing userclass crashes matlab

I have a userclass called insert.m which overload subsref/subsassgn. Below the classdef block, I have a function called DEMO which is NEVER called (only containing exemple code).
When I include the line [x=[];x.a= insert(1:10);] in this DEMO subfunction, Matlab crashes as soon as I try to use my class insert, and even [edit insert] crashes !! When I remove the line, everything works as expected, even if I write [x=[];x.a= insert(1:10);] in the command window.
This sounds weird as the buggy line is never executed, and is syntaxically correct. Is there any constraint on an overloaded subsref/subsassgin for an instance to be stored as a field in some struct ? Are there any other explanations ?

답변 (0개)

이 질문은 마감되었습니다.

질문:

2013년 6월 11일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by