调用matlab
提示:这里可以添加技术概要
核心源码
matlab:OleVariant;
procedure TForm1.Button1Click(Sender: TObject);
begin
Matlab.Execute(Memo1.Text); //执行Matlab命令
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
matlab:=CreateOleObject(‘Matlab.Application’); //创建一个matlab程序
end;
procedure TForm1.ListBox1Click(Sender: TObject);
var i:Integer;
begin
Memo1.Clear;
Case ListBox1.ItemIndex Of
0:Memo1.Lines.Add(‘[x,y,z]=peaks;’+#13#10+
‘meshz(x,y,z);’+#13#10+
‘axis([-inf inf -inf inf -inf inf]);’);
1:Memo1.Lines.Add(‘[x,y,z]=peaks;’+#13#10+
‘waterfall(x,y,z);’+#13#10+
‘axis([-inf inf -inf inf -inf inf]);’);
2:Memo1.Lines.Ad