You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dna2rna.m
    path of file: ./repos/CanlabCore/CanlabCore/OptimizeDesign11/core_functions
    
    the code of the file until where you have to start completion: function rna = dna2rna(listMatrix,restMatrix,restlength,numStim,dorests,trans2switch,trans2block,dofirst)
% function rna = dna2rna(listMatrix,restMatrix,restlength,numStim,dorests,trans2switch,trans2block,dofirst)
%
% transforms 'genetic' code used in crossbreeding (dna)
% into 'expressed' form (rna) used to build the design matrix 
%

    
function rna = dna2rna(listMatrix,restMatrix,restlength,numStim,dorests,trans2switch,trans2block,dofirst)
% function rna = dna2rna(listMatrix,restMatrix,restlength,numStim,dorests,trans2switch,trans2block,dofirst)
%
% transforms 'genetic' code used in crossbreeding (dna)
% into 'expressed' form (rna) used to build the design matrix 
%
% Tor Wager, 11/17/01

listMatrix = double(listMatrix);
restMatrix = double(restMatrix);

% before start of generation - ops on overall list
% ---------------------------------------------------------------------------------------------
if dorests,
		listMatrix = insert_rests(listMatrix,restMatrix,restlength,numStim);
end