Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2008-12-03
年龄: 40
帖子: 1
声望力: 0 ![]() |
![]()
在运行下面的程序时,老出错,提示如下:
?? One or more output arguments not assigned during call to 'F:\matlabwork\JC\invstat.m (invstat)'. Error in ==> JCex2 at 23 [Unu(I),Usgm(I)]=[invstat(Types(I),nu(I),sgm(I))]; 主程序如下: function [] = JCex2() clear all; clc % Fk--- function of limit state % dFk--- differetial of Fk nVar=3; % number of random variable syms x1 x2 x3 x4 x5 x6 x7 % x1 =R x2 = NG x3=NL Fki=input('Input function equation:','s'); %'x1-x2-x3'; Fk=eval(Fki); Svs=findsym(Fk); eVs=sym(Svs); nVar=length(eVs); for I=1:nVar dFk(I)=diff(Fk,eVs(I)); end % random variable characteristics %Types=input(['Input distribution types of ',Svs,': '],'s'); Types=input(['Input type of random variable ',Svs,': '],'s'); nui=input(['Input meam valus of ',Svs,': '],'s'); sgmi=input(['Input std valus of ',Svs,': '],'s'); nu=deal(str2num(nui)); sgm=deal(str2num(sgmi)); %$ loop nVar for I=1:nVar [Unu(I),Usgm(I)]=invstat(Types(I),nu(I),sgm(I)); end 子程序如下: function [pa,pb] = invstat(type,nu,sgm) sgms type nu sgm switch 'type' case 'beta' case 'Beta' pa = nu ; pb = sgm; case 'bino' case 'Binomial' pa = nu ; pb = sgm; % 'chi2' or 'Chisquare', % 'exp' or 'Exponential', case 'ev' pb = sqrt(6.) * sqrt(sgm) / pi; pa = nu - psi(1) * pb; % -psi(1) is euler's constant case 'Extreme Value' pb = sqrt(6.) * sqrt(sgm) / pi; pa = nu - psi(1) * pb; % -psi(1) is euler's constant % 'f' or 'F', % 'gam' or 'Gamma', % 'gev' or 'Generalized Extreme Value', % 'gp' or 'Generalized Pareto', % 'geo' or 'Geometric', % 'hyge' or 'Hypergeometric', case 'evv' pb = (pi/sqrt(6)) ./ sqrt(sgm); pa = nu + psi(1) / pb; % -psi(1) is euler's constant case 'logn' % vxR = sgm/mu; % pb = sqrt(log(1+vxR^2)); % pa = log(mu/sqrt(1+vxR^2)); s2 = 2.*log((sgm+nu^2)^(1/2)/nu); pb = sqrt(s2); pa = log(nu^2/(sgm+nu^2)^(1/2)); case 'Lognormal' s2 = 2.*log((sgm+nu^2)^(1/2)/nu); pb = sqrt(s2); pa = log(nu^2/(sgm+nu^2)^(1/2)); % 'nbin' or 'Negative Binomial', % 'ncf' or 'Noncentral F', % 'nct' or 'Noncentral t', % 'ncx2' or 'Noncentral Chi-square', case 'norm' pa = nu ; pb = sqrt(sgm); case 'Normal' pa = nu ; pb = sqrt(sgm); % 'poiss' or 'Poisson', % 'rayl' or 'Rayleigh', % 't' or 'T', % 'unif' or 'Uniform', % 'unid' or 'Discrete Uniform', % 'wbl' or 'Weibull'. otherwise disp('such random variable type is not defined!'); end 到底是怎么回事啊?搞了好久都没有搞定啊?请大家帮帮忙啊! |
![]() |
![]() |
![]() |
主题工具 | |
显示模式 | |
|
|
![]() |
||||
主题 | 主题作者 | 版面 | 回复 | 最后发表 |
[求助]如何产生不规则波? | allen_1107 | MATLAB论坛 | 2 | 2009-03-13 23:44 |
[求助]怎么把T检验的T值转化为P值 | lgy1981 | MATLAB论坛 | 1 | 2009-03-02 16:22 |
[求助]bp神经网络(急) | sosnyf621 | MATLAB论坛 | 0 | 2008-12-03 16:21 |
[求助]大家好,请问下在matlab编程里如何编三角函数绝对值问题 | sunnyrain80 | MATLAB论坛 | 5 | 2008-11-13 23:10 |