i have battery dataset in a struct format. i need to extract "capacity" data alone from the dataset. the capacity data is present under 'discharge' only.
here is the dataset structure
i used the following code
z = load('B0005.mat');for i = 1:length(z.B0005.cycle) a(i) = z.B0005.cycle(i).data.Capacity;end
the problem is, the first field('charge') does not contain 'capacity' data so it throws an error:
Reference to non-existent field 'Capacity'.Error in Untitled (line 3)a(i) = z.B0005.cycle(i).data.Capacity;
can anyone please tell me where iam going wrong and help me out in correcing the error. i want to read just the capacity data situated under discharge field
Best Answer