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: write_switch.m
    path of file: ./repos/cocoSim-deprecated/src/middleEnd
    
    the code of the file until where you have to start completion: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of CoCoSim.
% Copyrigh
    
function [output_string] = write_switch(unbloc, inter_blk, criteria, threshold)

output_string = '';

[list_out] = list_var_sortie(unbloc);
[list_in] = list_var_entree(unbloc, inter_blk);

cond_dt = Utils.get_lustre_dt(unbloc.inports_dt{2});

if ~strcmp(criteria, 'u2 ~= 0')
	if islogical(threshold) && strcmp(cond_dt, 'bool')
		% If both condition input and threshold are booleans
		[list_threshold] = Utils.list_cst(threshold, 'int');
	elseif strcmp(cond_dt, 'bool')
		% If only the condition input is a boolean
		if isinteger(threshold)
			[list_threshold] = Utils.list_cst(threshold, 'int');
		else
			[list_threshold] = Utils.list_cst(threshold, 'real');
		end