matlab错误expected,求助:帮我看看哪出错了?

icon1.gif 求助:帮我看看哪出错了?

小弟想用embeded matlab function 模块,里面代码如下:

function[p,v,h,s]=tx(t,x)

p=psaturation(t);

[vwater,hwater,swater]=ptwater(p,t);

[vsteam,hsteam,ssteam]=ptsteam(p,t);

v=vwater+x*(vsteam-vwater);

h=hwater+x*(hsteam-hwater);

s=swater+x*(ssteam-swater);

其中p=psaturation(t);

vwater,hwater,swater]=ptwater(p,t);

[vsteam,hsteam,ssteam]=ptsteam(p,t);

是三个M函数,运行时正确无误,但当运行这个embeded matlab function 模块时出现以下错误:

1,Expected either a logical, char, single, or double.

Found an mxArray. mxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may be used on the right-hand side of assignments and as arguments to MATLAB calls.

Function 'tx' (#82.131.137), line 6, column 13:

"vsteam"

2,Expected either a logical, char, single, or double.

Found an mxArray. mxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may be used on the right-hand side of assignments and as arguments to MATLAB calls.

Function 'tx' (#82.159.165), line 7, column 13:

"hsteam"

3,Expected either a logical, char, single, or double.

Found an mxArray. mxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may be used on the right-hand side of assignments and as arguments to MATLAB calls.

Function 'tx' (#82.187.193), line 8, column 13:

"ssteam"

4,Errors occurred during parsing of Embedded MATLAB function 'tx'(#82)

5,Embedded MATLAB Interface Error: Port width mismatch. Input port "x"(#89) expects a scalar. The signal is a one dimensional vector with 1 elements.

不知道是不是能这样调用函数的原因?望高手解答下!先谢谢了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值