Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.fr>
Newsgroups: comp.soft-sys.matlab
Subject: Re: export to MPS file
Date: Wed, 16 Apr 2008 23:26:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 26
Message-ID: <fu61ua$s55$1@fred.mathworks.com>
References: <fs33vs$kka$1@fred.mathworks.com> <fs5d02$9ac$1@fred.mathworks.com> <fu6126$821$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.fr>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1208388362 28837 172.30.248.35 (16 Apr 2008 23:26:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 16 Apr 2008 23:26:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:463461


Saver:

function OK=SaveMPS(filename, Contain)
%
% OK=SaveMPS(filename, Contain)
%
% Save cell sring Contain in file "filename"
%
% See BuildMPS
%
% Author: Bruno Luong
% Last update: 17/April/2008

OK=0;
fid=fopen(filename,'w');
if fid==-1
    return
end

for n=1:size(Contain,1)
    fprintf(fid,'%s\n', Contain(n,:));
end

fclose(fid);
OK=1;