Skip to content
......@@ -4,8 +4,8 @@
<?xml-stylesheet type="text/xsl" href="http://www.mathworks.com/namespace/info/v1/info.xsl"?>
<matlabrelease>2010a</matlabrelease>
<name>Table Toolbox</name>
<matlabrelease>2011b</matlabrelease>
<name>Tabular Expression Toolbox</name>
<type>Toolbox</type>
<icon>$toolbox/matlab/icons/matlabicon.gif</icon>
<help_location>./html</help_location>
......
function [ status, results ] = safe_execute_external_command( cmd )
%SAFE_EXECUTE_EXTERNAL_COMMAND Executes a command avoiding various Matlab pitfalls
% Exectues the given command using the system function, while avoid
% various pitfalls that occur while running the matlab context.
% Specifically, it removes matlab related paths from the LB_LIBRARY_PATH.
% It restores them on exit.
old_path = getenv('LD_LIBRARY_PATH');
new_path = old_path;
new_path = regexp(new_path, ':', 'split');
new_new_path = '';
for i=1:size(new_path, 2)
finds = strfind(lower(new_path(i)), 'matlab');
if size(finds{1}) == [0 0]
new_new_path = [new_new_path new_path{i} ':']; %#ok<AGROW> Since size is dynamically found
end
end
setenv('LD_LIBRARY_PATH', new_new_path(1:size(new_new_path,2)-1))
had_error = 0;
try
[ status, results ] = system( cmd );
catch exception
had_error = 1;
end
setenv('LD_LIBRARY_PATH', old_path);
if had_error == 1
throw(exception)
end
end
......@@ -54,7 +54,7 @@ function blkStruct = slblocks
% Name of the subsystem which will show up in the Simulink Blocksets
% and Toolboxes subsystem.
%
blkStruct.Name = ['Table Toolbox'];
blkStruct.Name = ['Tabular Expression Toolbox'];
%
% The function that will be called when the user double-clicks on
......@@ -77,7 +77,7 @@ blkStruct.IsFlat = 1;
% Simulink Extras block library.
%
Browser(1).Library = 'TableLibrary';
Browser(1).Name = 'Table Toolbox';
Browser(1).Name = 'Tabular Expression Toolbox';
Browser(1).IsFlat = 1;% Is this library "flat" (i.e. no subsystems)?
......
......@@ -226,7 +226,7 @@ function statusbarObj = setFigureStatus(hFig, deleteFlag, updateFlag, statusText
if isempty(statusbarObj)
statusbarObj = com.mathworks.mwswing.MJStatusBar;
jProgressBar = javax.swing.JProgressBar;
set(jProgressBar, 'Visible','off');
jProgressBar.setVisible(false);
statusbarObj.add(jProgressBar,'West'); % Beware: East also works but doesn't resize automatically
jRootPane.setStatusBar(statusbarObj);
end
......
function [] = unsuppressed_output_directory(varargin)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
% look in the current directory
switch nargin
case 0
current_directory = '.';
recurse = true;
case 1
current_directory = varargin{1};
recurse = true;
case 2
current_directory = varargin{1};
recurse = varargin{2};
end
list_of_files = dir(current_directory);
for i = 1:size(list_of_files)
% ignore the . and .. basically anything starting with . ie .svn, etc.
no_search_dir = regexp(char(list_of_files(i).name),'^\.','once');
if ~isempty(no_search_dir)
continue;
end
if (list_of_files(i).isdir)
if recurse
unsuppressed_output_directory([current_directory '/' list_of_files(i).name],recurse);
end
end
end
what_info = what(current_directory);
for j = 1:size(what_info.m,1)
unsuppressed_output_file([current_directory '/' char(what_info.m(j))]);
end
end
function [] = unsuppressed_output_file(file)
% [] = unsuppressed_output_file(file)
%
% Outputs to the command window a list of the lines in file which likely do
% not have suppressed output. Lines with keywords which will not produce outputs ie
% (if, else, continue, function, etc.) are ignored.
% look through a file for lines which are unsuppressed
string = [char(10) 'file = ' file char(10)];
fid = fopen(file);
if fid == -1
string = [string 'unable to open file' char(10)];
fprintf('%s',string);
return;
end
data = fread(fid);
cstring = char(rot90(data));
lines = regexp(cstring,'\n','split');
count = 0;
for i = 1:size(lines,2)
% don't consider comments at begining
comment = regexp(char(lines(i)),'\s*%.*','once');
if ~isempty(comment)
continue;
end
% don't consider keywords at begining of expression
keyword = regexp(strtrim(char(lines(i))),'^(end|function|methods|properties|classdef|for|if|elseif|else|switch|case|try|catch|otherwise|while|return|continue|warning|break|global|persistent|set|delete)','once');
if ~isempty(keyword)
continue;
end
% don't consider multiline expressions
multiline = regexp(strtrim(char(lines(i))),'\.\.\.$','once');
if ~isempty(multiline)
continue;
end
% don't consider empty lines
if isempty(char(lines(i)))
continue;
end
% don't consider lines of just spaces
if isempty(strtrim(char(lines(i))))
continue;
end
% don't consider lines that end in a semi-colon and have an optional
% comment after
semis = regexp(strtrim(char(lines(i))),'.*;(\s*%.*)*','once');
if ~isempty(semis)
continue;
end
% if string passes all these tests we infer that it is what we are
% looking for
count = count + 1;
string = [string 'line <a href="matlab: opentoline(which(''' file '''),' num2str(i) ')">' num2str(i) '</a>: ' char(lines(i)) char(10)];
end
% only print something if we have found a line that meets our criteria
if count ~= 0
fprintf('%s',string);
end
fclose(fid);
end
\ No newline at end of file