matlab创建function出错,代码:function basePS=functionbasePS(n)%UNTITLED2 Summary of this function goes here% Detailed explanation goes heresyms tbasePS=zeros(1,n+1);for i=0:1:nif 0
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/29 22:44:55
![matlab创建function出错,代码:function basePS=functionbasePS(n)%UNTITLED2 Summary of this function goes here% Detailed explanation goes heresyms tbasePS=zeros(1,n+1);for i=0:1:nif 0](/uploads/image/z/5329021-13-1.jpg?t=matlab%E5%88%9B%E5%BB%BAfunction%E5%87%BA%E9%94%99%2C%E4%BB%A3%E7%A0%81%EF%BC%9Afunction+basePS%3DfunctionbasePS%28n%29%25UNTITLED2+Summary+of+this+function+goes+here%25+Detailed+explanation+goes+heresyms+tbasePS%3Dzeros%281%2Cn%2B1%29%3Bfor+i%3D0%3A1%3Anif+0)
matlab创建function出错,代码:function basePS=functionbasePS(n)%UNTITLED2 Summary of this function goes here% Detailed explanation goes heresyms tbasePS=zeros(1,n+1);for i=0:1:nif 0
matlab创建function出错,
代码:
function basePS=functionbasePS(n)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
syms t
basePS=zeros(1,n+1);
for i=0:1:n
if 0
matlab创建function出错,代码:function basePS=functionbasePS(n)%UNTITLED2 Summary of this function goes here% Detailed explanation goes heresyms tbasePS=zeros(1,n+1);for i=0:1:nif 0
basePS(i)=nchoosek(ceil(n/2)+i,i)*t^i*(1-t)^(ceil(n/2)+1);等号右边是一个带t的公式,即存入 basePS(i)的是一个带t的公式,而不是正数或逻辑类型的数,所以报错