Array of Struct: Index exceeds matrix dimensions
1 view (last 30 days)
Show older comments
Hi! I have a problem with an array of struct: I have an array that includes 106 struct. I want to convert string in number. If I use the function datevec on a single struct I have not problems; on the contrary when I want to apply the function datevec to all the structs in the array with a for cycle, the code generate an error: 'Index exceeds matrix dimensions'
for i=1:106
date=datevec(s(1,i).locs(:,1));
% Data di inizio rilevazione
dateStart=datevec(s(1,i).places.startdate(:,1));
% Data fine rilevazione
dateEnd=datevec(s(1,i).places.endate(:,1));
end
I don't understand what is my error! Maybe I have to pre-allocate date, dateStart and dateEnd like struct?
0 Comments
See Also
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!