permutation of two lists based on criteria

4 次查看(过去 30 天)
i hope someone can help me, how to achieve this. I have to files with list of data, i am trying to calculate possible permutations between the two lists and save them to a new file. i realized that my output file is very big ( more than 30 Gb ). i would like to know how to make permutation only between the data that meets specific criteria. F.eks if :
Data 1: VHxBxVVxPx255x98x Data 2: VHxBxVVxPx255x98x
only permutate if char(6 and 7) from data1 = char(6 and 7) from data2.
my code so far :
fid = fopen( 'file1.txt' );
cac = textscan( fid, '%20s' );
fclose( fid );
num = cac{1};
fid = fopen( 'file2.txt' );
cac = textscan( fid, '%20s' );
fclose( fid );
str = cac{1};
fid = fopen( 'file3.txt', 'w' );
for ii = 1 : length( num )
for jj = 1 : length( str )
fprintf( fid, '%1s - %1s\n', num{ii}, str{jj} );
end
end
fclose( fid );

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by