>> for K = 1:3,struct(["A",num2str(K)],K),endfor
ans =
scalar structure containing the fields:
A1 = 1
ans =
scalar structure containing the fields:
A2 = 2
ans =
scalar structure containing the fields:
A3 = 3
>> A1
error: 'A1' undefined near line 1 column 1 ??????????????????????
--
Sent from:
http://octave.1599824.n4.nabble.com/Octave-General-f1599825.htmlYou are accessing your struct in a wrong manner.
First of all, you haven't given the struct a name, i.e. you create a struct going nowhere.
Second, you access data in a struct through keys.
--Sergei.
| GNU Octave: Creating StructuresGNU Octave: Creating Structures |
|
|