调用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.Add(‘[x,y,z]=peaks;’+#13#10+
‘meshc(x,y,z);’+#13#10+
‘axis([-inf inf -inf inf -inf inf]);’);

这篇博客介绍了如何在DELPHI应用程序中调用MATLAB,通过核心源码展示了如何创建MATLAB对象并执行命令,实现不同类型的三维图形绘制,包括meshz、waterfall、meshc和surfc等。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



