Error using struct, too many input arguments

Hi, I am creating a strucure as following code but get a error message saying 'Error using struct. Too many input arguments'.
cyl(1)=struct('code','x','dimensions',struct('rad',3,'height',6),'weight',7);
How can I fix this problem? Many thanks in advance!!!

댓글 수: 1

Which release are you using? That code works for me.
Also, what shows up for
which struct
I am wondering if you are accidentally invoking a third-party struct() function.

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

답변 (1개)

David Hill
David Hill 2020년 4월 5일

0 개 추천

Works perfectly for me. What version of MATLAB are you using?
cyl=struct('code','x','dimensions',struct('rad',3,'height',6),'weight',7);

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

태그

질문:

2020년 4월 5일

댓글:

2020년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by