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/05/02 12:23:25
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 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的公式,而不是正数或逻辑类型的数,所以报错