声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3180|回复: 15

[混合编程] maple和matlab怎么通信

[复制链接]
发表于 2008-5-9 17:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
我在maple中求得的公式怎么导入到matlab中呢?

我复制粘贴之后,在matlab中出现了好多行,而且也没有我想要的公式。

他们中间应该有一个接口的吧,我在论坛中搜索了一下,没有找到,还请各位大侠相助。

谢谢

[ 本帖最后由 eight 于 2008-5-12 18:53 编辑 ]
回复
分享到:

使用道具 举报

发表于 2008-5-10 18:25 | 显示全部楼层
Syntaxr = maple('statement')
r = maple('function',arg1,arg2,...)
[r, status] = maple(...)
maple('traceon') or maple trace on
maple('traceoff') or maple trace off
Descriptionmaple('statement') sends statement to the Maple kernel and returns the result. A semicolon for the Maple syntax is appended to statement if necessary. maple('function',arg1,arg2,...) accepts the quoted name of any Maple function and associated input arguments. The arguments are converted to symbolic expressions if necessary, and function is then called with the given arguments. If the input arguments are syms, then maple returns a sym. Otherwise, it returns a result of class char. [r,status] = maple(...) is an option that returns the warning/error status. When the statement execution is successful, r is the result and status is 0. If the execution fails, r is the corresponding warning/error message, and status is a positive integer. maple('traceon') (or maple trace on) causes all subsequent Maple statements and results to be printed. maple('traceoff') (or maple trace off) turns this feature off. ExamplesEach of the following statements evaluate  to 100 digits. maple('evalf(Pi,100)')
maple evalf Pi 100
maple('evalf','Pi',100)
The statement [result,status] = maple('BesselK',4.3)
returns the following output because Maple's BesselK function needs two input arguments. result =
Error, (in BesselK) expecting 2 arguments, got 1
status =
2
The traceon command shows how Symbolic Math Toolbox commands interact with Maple. For example, the statements syms x
v = [x^2-1;x^2-4]
maple traceon % or maple trace on
w = factor(v)
return v =
[ x^2-1]
[ x^2-4]

statement:
   map(ifactor,array([[x^2-1],[x^2-4]]));
result:
   Error, (in ifactor) invalid arguments
statement:
   map(factor,array([[x^2-1],[x^2-4]]));
result:
   matrix([[(x-1)*(x+1)], [(x-2)*(x+2)]])

w =

[ (x-1)*(x+1)]
[ (x-2)*(x+2)]

评分

1

查看全部评分

 楼主| 发表于 2008-5-11 09:04 | 显示全部楼层

回复 2楼 的帖子

谢谢
这是在matlab中的help maple吧

我也help了。
怎么感觉不是我所需要的那个。

我现在在maple中已经推导出公式,就想在matlab中要一个复制粘贴的效果的公式,该怎么弄呢???
 楼主| 发表于 2008-5-13 20:15 | 显示全部楼层
请问各位大侠,

matlab中调用maple的函数有哪些呢?

而且,在maple中算的公式,直接导入的matlab中是怎么弄的呢??

谢谢!!
发表于 2008-5-16 19:07 | 显示全部楼层
可以在matlab中用符号运算,也是一样的。
 楼主| 发表于 2008-5-16 20:00 | 显示全部楼层

回复 5楼 的帖子

请问你说的是直接把应该在maple中推导的公式放在matlab中吗??


还有一个就是:我现在已经在maple中推导的公式,怎么粘贴到matlab中呢??
matlab和maple中提供这个功能吗???

谢谢!!!
发表于 2008-5-16 20:04 | 显示全部楼层

回复 6楼 的帖子

5楼的意思应该是直接在matlab中进行推导
 楼主| 发表于 2008-5-16 20:20 | 显示全部楼层

回复 7楼 的帖子

不行啊。。
是不是还要调用什么函数呢?
直接运算了,没有结果啊
发表于 2008-5-16 20:59 | 显示全部楼层

回复 8楼 的帖子

请把你的方程给出来
 楼主| 发表于 2008-5-17 17:50 | 显示全部楼层

回复 9楼 的帖子

a:=matrix(3,4)
b:=matrix(4,1)
c:=simplify((a)*(b))
得到c是一个3*1的向量。

这中间有2个问题:
1、得到的c不是最简的,怎么把它化简呢?
2、我得到的最终的c要怎么样输入到matlab中去?

请求解答---------------
发表于 2008-5-17 21:44 | 显示全部楼层
可以将你的结果做成一个函数,然后通过maple来直接调用这个函数计算
不过需要注意的是maple和matlab的传递是通过字符型变量实现的
所以调用的时候注意数据类型的转换就可以了

评分

1

查看全部评分

 楼主| 发表于 2008-5-17 23:02 | 显示全部楼层

回复 11楼 的帖子

教授能不能说的具体一点
我对这个还是一头雾水啊。。

现在我如果在maple中有一个文件:maple111,我想把他在matlab中打开,而且只要该文件中的结果,我在matlab中应该怎么做呢????

非常感谢!!!
发表于 2008-5-18 01:22 | 显示全部楼层
安装Maple Toolbox for MATLAB,实现两个软件的无缝连接,然后就可以相互调用了

评分

1

查看全部评分

 楼主| 发表于 2008-5-18 10:09 | 显示全部楼层

回复 13楼 的帖子

在matlab中不能直接调用吗??


那个工具箱现在网上好像没有的哦。。

教授有吗??
能不能传我一个?
279720994@qq.com。。。
不胜感激。。。。
发表于 2008-5-18 13:24 | 显示全部楼层
记得maple 11或者12里面就包含了。

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-20 21:15 , Processed in 0.060455 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表