Code covered by the BSD License  

Highlights from
MOtion DEcision (MODE) model

image thumbnail
from MOtion DEcision (MODE) model by Massimiliano Versace
MOtion DEcision (MODE) model is a neural model of perceptual decision-making.

mfc2html.html

mfc2html.m


function mfc2html(varargin)
% function mfc2html(imageFile, bgcolor)
% Purpose : convert all files with suffix of type fileSuffixType .m
%           into html format so users can view them with a browser
% imageFile: An image of type .gif, .jpg to be displayed
%            in the top frame of a 3-frame html page
%            If file not in current dir, must provide path
% bgcolor  : Background RGB color for the source code listing
% A perl script is run via the MATLAB perl command to generate the html files
% Other software required: Perl, MATLAB
% Usage: >> mfc2html      % will be prompted for image file name and bgcolor
%        >> mfc2html('BUlogo.gif', [0.8, 0.8, 0.8]) % won't prompt for input

fileSuffixType = '.m';  % set to take m-files only
if nargin == 0
    [imageFile, imagePath] = uigetfile({'*.gif', 'GIF Files (*.gif)'; ...
                                        '*.jpg', 'JPEG Files (*.jpg)'; ...
                                        '*.*',   'All Files (*.*)'}, ...
                   'Pick an image file of types .gif, .jpg', 'BUlogo.gif');
    bgcolor = uisetcolor('Source code BG color');
    if bgcolor == 0
        bgcolor = [0.8 0.8 0.8]; % default to gray if user pressed "cancel"
    end
end
perl('mfc2html.pl', fileSuffixType, [imagePath imageFile], ...
    num2str(bgcolor(1)), num2str(bgcolor(2)), num2str(bgcolor(3)))

Contact us at files@mathworks.com