Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation



06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

function input = capitalise(input)
% CAPITALISE makes the first letter of the string into a capital letter
% Output = capitalise(input) works with mixed cell arrays, strings, and
% character arrays

% checks the number of arguments
error(nargchk(1, 1, nargin))

% if its a character array
if ischar(input) && ~isempty(input)
    % makes the whole first column upper case
    input(:, 1) = upper(input(:, 1));

elseif iscell(input)
    % loops round for each recursively - allows non-flat cell arrays to be
    % capitalised
    input = cellfun(@capitalise, input, 'UniformOutput', false);
elseif isstruct(input)
    % does the same for structures
    input = structfun(@capitalise, input, 'UniformOutput', false);

Contact us