permutation of two lists based on criteria
4 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!