필터 지우기
필터 지우기

Why doesn't Matlab call the overloaded subsref method?

조회 수: 1 (최근 30일)
Patrick Mboma
Patrick Mboma 2023년 2월 6일
댓글: Captain Karnage 2023년 6월 26일
Hi,
I have a class in which I have overloaded both subsref (and subasgn)
for some constructed object obj, I am able to sucessfully do the following :
  • obj(1)
  • obj{1}
  • obj('some string')
But I am not able to do
  • obj{'some string'}
In this particular case, when I call subsref with curly braces around a string, Matlab does not call the overloaded subsref. The error message I get is "Too many output arguments."
I don't understand what is going on
  댓글 수: 1
Captain Karnage
Captain Karnage 2023년 6월 26일
My best guess is that it's likely there's an error in your case '{}' that is creating an output for every char character. In order for someone to actually figure it out, however, you'd have to provide your subsref code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by