Code covered by the BSD License  

Highlights from
ECRobotInstaller – Simplified installation of tools for Embedded Coder Robot

image thumbnail

ECRobotInstaller – Simplified installation of tools for Embedded Coder Robot

by

 

02 Sep 2009 (Updated )

Simplifies the installation of ECRobot, a Simulink platform for LEGO Mindstorms NXT code generation

ecrobot_samples
function ecrobot_samples
% ECROBOT_SAMPLES
%
%   ECROBOT_SAMPLES changes the current directory to the "samples" 
%   subdirectory in the ECRobot installation.

%   Copyright 2009 The MathWorks, Inc.

if ~(exist('ecrobot_install_config', 'file') == 2)
    fprintf('Unable to find ecrobot_install_config.m\n');
    return;
end

config = ecrobot_install_config;
if ~isfield(config, 'ECRobot_InstallationDirectory')
    error('ecrobot_install_config does not contain ''ECRobot_InstallationDirectory''\n');
end
ecrobotdir = config.ECRobot_InstallationDirectory;
olddir = pwd;

if exist(ecrobotdir, 'dir') == 7
    cd(ecrobotdir);
    if isdir('ecrobotNXT')
        cd('ecrobotNXT');
    end
    if isdir('samples')
        cd('samples');
        fprintf('Currently in ECRobot samples directory:\n');
        fprintf('   %s\n', pwd);
    else
        fprintf('Unable to find ECRobot samples directory:\n');
        fprintf('  %s\\samples\n', pwd);
        cd(olddir);
    end
    
else
    fprintf('Unable to find ECRobot installation directory:\n');
    fprintf('   %s\n', ecrobotdir);
end

Contact us