Hi, I'm trying to transcribe protein letters to DNA codons. I have a single row array that looks like:
[N1 N2 N3 N4 ...]
Each vector looks like:
N1 = {'UUU' 'UUG' 'UUC'} orN2 = {'AUU' 'AUG' 'AUC' 'AAU' 'AAG'}(number of cells can vary from 1 to 6)
I want every combination of the values of these vectors BUT only in the order they appear in the main [N1 N2] vector. For example, 'UUU AUU' and "UUU AUG' are desirable but 'AUU UUU' and 'AUG UUU' are NOT.
Also every combination must contain a value from each vector. So if the array has 20 'N' vectors then each combination needs 20 'three letter' strings.
I'm not much of a coder and I've ended up in a useless mess of nested loops. I think this is a problem for recursion but I'm stuck 🙁
Your help and time are greatly appreciated! 🙂 Also please let me know if I can clarify anything.
edit: put examples in matlab syntax
Best Answer