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: spm_eeg_simulate_frominv.m
    path of file: ./repos/spm12
    
    the code of the file until where you have to start completion: function [Dnew]=spm_eeg_simulate_frominv(D,prefix,val,whitenoise,SNRdB,trialind)
% Project a source inversion solution back out to the sensor level plus some noise
% D          - original dataset
% prefix     - prefix of new dataset
% val        - use solution (and lead fields) corresponding to this index
% whitenoise - total rms white noise in Tesla
% SNRdB      - SNR in dBs (alternative to specifying white noise)
% trialind   - trials in which the simulated signal is to appear
%              (all other trials will be noise)
%__________________________________________________________________________
% Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging

% Gareth Barnes
% $Id: spm_eeg_simulate_frominv.m 5664 2013-10-01 18:39:05Z spm $



    
function [Dnew]=spm_eeg_simulate_frominv(D,prefix,val,whitenoise,SNRdB,trialind)
% Project a source inversion solution back out to the sensor level plus some noise
% D          - original dataset
% prefix     - prefix of new dataset
% val        - use solution (and lead fields) corresponding to this index
% whitenoise - total rms white noise in Tesla
% SNRdB      - SNR in dBs (alternative to specifying white noise)
% trialind   - trials in which the simulated signal is to appear
%              (all other trials will be noise)
%__________________________________________________________________________
% Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging

% Gareth Barnes
% $Id: spm_eeg_simulate_frominv.m 5664 2013-10-01 18:39:05Z spm $


%-Load in original data
%==========================================================================


if nargin<2, prefix     = ''; end