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: arSetObservables.m
    path of file: ./repos/d2d/arFramework3/Advanced/RealisticSimulation
    
    the code of the file until where you have to start completion: function arSetObservables(cond,obslog)
%OBSERVABLES Define Observables
%   Detailed explanation goes here
if ~exist('cond','var') || isempty(cond)
    cond=1;
end
if ~exist('obslog','var') || isempty(obslog)
    fprintf('No information about logging given. Logarithm of observables is drawn realisticly. \nWatch out! Logarithm of intensities can cause differences to original model. If this is not what you want, set arRealisticDesign([],false).\n')
    obslog = false;
end

global ar

data = ar.model(1).condition(cond).xFineSimu;
label = ar.model(1).x;
load([fileparts(mfilename('fullpath')) filesep 'ObservableDraw.mat']);

% Are there constant states ? Throw them out.
Const = [];
for i=1:size(data,2)
    if (abs(range(data(:,i))/max(data(:,i))) < 1e-8 || isinf(range(data(:,i))/max(data(:,i))) || isnan(range(data(:,i))/max(data(:,i))) || abs(range(data(:,i)))<1e-8 )
        Const = [Const i];
    end

    
function arSetObservables(cond,obslog)
%OBSERVABLES Define Observables
%   Detailed explanation goes here
if ~exist('cond','var') || isempty(cond)
    cond=1;
end
if ~exist('obslog','var') || isempty(obslog)
    fprintf('No information about logging given. Logarithm of observables is drawn realisticly. \nWatch out! Logarithm of intensities can cause differences to original model. If this is not what you want, set arRealisticDesign([],false).\n')
    obslog = false;
end

global ar

data = ar.model(1).condition(cond).xFineSimu;
label = ar.model(1).x;
load([fileparts(mfilename('fullpath')) filesep 'ObservableDraw.mat']);

% Are there constant states ? Throw them out.
Const = [];
for i=1:size(data,2)
    if (abs(range(data(:,i))/max(data(:,i))) < 1e-8 || isinf(range(data(:,i))/max(data(:,i))) || isnan(range(data(:,i))/max(data(:,i))) || abs(range(data(:,i)))<1e-8 )
        Const = [Const i];
    end
end
data(:,Const) = [];
label(Const) = [];
ns = length(label);
if ns == 0
    error('No dynamics found, just constants. Check in arSetObservables.m')
end