Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@prog/mup2mat.m @ 52:daf4eab1a51e database-connection-manager tip
Fix. Default password should be [] not an empty string
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:29:47 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
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