I have the following code, I'm trying to create an structure with field names from the cellarray of string.
data1 has the following data, it's a 5x4:
1 5 298 53
2 9 284 35
3 0 582 329
4 17 892 67
45 183 45 29
data1 = xlsread('data1.xlsx');
namesoftags = {'timeaxis','cputime','flux','volts'};
for i =1:4
S = cell2struct(data1(:,i),namesoftags(i));
end
But it's giving this error:
Error using cell2struct
Unknown command option.
Error in structuredemo (line 4)
S = cell2struct(data1(:,i),namesoftags(i));
Thank you.