I have a 1 x 521 structure array called 'data' with 20 fields. One of the field is 'GS', which stands for Ground speed. I am trying to find the instantaneous Ground Speed for all arrays, and make a new field called 'instantaneous_GS'. The following is the code I am using.
for n = 1 : length(data) for i = 1 : length(data(n).GS) data(n).instantenous_GS = (data(n).GS(i) + data(n).GS(i + 1))/2; endend
I am a new MATLAB user, and have no clue what is the problem with my code. Can anyone help me? Thanks.
Best Answer