Hello everyone,
I've been trying to preallocate a vector in which each cell will be a structure of 42 fields like thi:
data = zeros(1,9);
for i=1:9
if(i~=5)
data(i) = load(['DPsv0000',num2str(i),'.mat']);
end
end
Because I need the nine different structures in the same vector for the rest of the code and I want it to be time efficient. However, I can't seem to find a way for the preallocation to work. In fact, doing this, I get the following error:
Conversion to double from struct is not possible.
Error in MECA0062_Gaspar_1 (line 135)
data(i) = load(['DPsv0000',num2str(i),'.mat']);
Can anyone know if it is even possible to do what I'm trying?
Thanks everyone, have a good day!
Audric
0 Comments
Sign in to comment.