Error using struct, too many input arguments

2 Ansichten (letzte 30 Tage)
jessica tu
jessica tu am 5 Apr. 2020
Kommentiert: Walter Roberson am 5 Apr. 2020
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 Kommentar
Walter Roberson
Walter Roberson am 5 Apr. 2020
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by