我正在使用递归函数,但我想存储 cp 和轴的所有中间值。但我想不通
[cp,axial]=powerCoefficient(nturbines)
function [cp,axial]=powerCoefficient(iturbines)
if iturbines==0
cp=0;
axial=0;
else
syms a
expression=matlabFunction(4*a*(1-a)^2+(1-2*a)^3*powerCoefficient(iturbines-1));
diff1=diff(expression,a);
solution=double(solve(diff1));
axial=solution(find(solution >0 &solution<1));
cp = expression(axial);
end
end
我会很感激一些帮助。提前致谢!