Hello. I have a structure array 'data', and I am trying to define a new variable called 'loc'. The problem I am encountering is that I want to get for example, when I write something like loc(1) in the command window, I get [data(1).Lat data(1).Lng].
The following is the code I am using.
for n = 1 : length(data) if ~isempty(data(n).Lat & data(n).Lng) loc(n) = [data(n).Lat data(n).Lng]; end end
I have just started using Matlab and will greatly appreciate your help. Thanks in advance.
Best Answer