view m-toolbox/classes/+utils/@prog/mup2mat.m @ 15:ce3fbb7ebe71
database-connection-manager
Remove broken functions from utils.jmysql
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − % MUP2MAT converts Mupad string to MATLAB string
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: MUP2MAT converts:
+ − % MUP2MAT converts the Mupad string r containing
+ − % matrix, vector, or array to a valid MATLAB string.
+ − %
+ − % NOTE: Copied from the Symbolic Toolbox function sym/matlabFunction
+ − %
+ − % VERSION: $Id: mup2mat.m,v 1.1 2009/05/25 14:14:08 mauro Exp $
+ − %
+ − % HISTORY: 21-05-2009 M Hueller & L Ferraioli
+ − % Creation
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function r = mup2mat(r)
+ −
+ − r = strtrim(char(r));
+ − % Special case of the empty matrix or vector
+ − if strcmp(r,'vector([])') || strcmp(r,'matrix([])') || ...
+ − strcmp(r,'array([])')
+ − r = '[]';
+ − else
+ − % Remove matrix, vector, or array from the string.
+ − r = strrep(r,'matrix([[','['); r = strrep(r,'array([[','[');
+ − r = strrep(r,'vector([','['); r = strrep(r,'],[',';');
+ − r = strrep(r,']])',']'); r = strrep(r,'])',']');
+ − end
+ − end