match and merge data between multiple structures and single structures

1 次查看(过去 30 天)
Hi,
I have one strcuture (A) which needs to be matched (if meets certain criteria) with a field "new" (which is 30000*15) from multiple other structures (B01, B02, B03...B036) which are huge (266*1). Once the criteria is met, I want to store the data from B01.new(:,7) struture into A with a new field 'SS'. I can do this for a single strcuture, but unable to do with multiple strcutures. Loading more than two B structures, causes out of memory. So I want to load one B strcuture, search, match and clear, and load next B structure, etc.... Any help is highly appreciated !
My code for one strcuture match is following:
load('A.mat')
load('B01.mat');
empty =[];
for ii = 1:length(A)
for jj = 1: length(B01)
for kk = 1:length(B01(jj).new)
if A(ii).DOY==B01(jj).new(kk,13) && (sqrt(((A(ii).Lat-B01(jj).new(kk,5)).^2)+((A(ii).Lon-B01(jj).new(kk,6)).^2))<=0.325) && A(ii).HHMMSS==B01(jj).new(kk,14) <= 25959
tmp1 = B01(jj).new(kk,7);
empty = [empty, tmp1];
A(ii).SS = empty';
clear tmp1
end
end
end
empty =[];
end

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by