Calling Functions Vectors Array
2 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have the following function:
function c = relation( n )
if n==0
c = 1;
elseif n==1
syms x
c = [x 0];
else
syms x
c = ((2*n-1)*x*[relation(n-1),0] - (n-1)*[0,0,relation(n-2)])/n;
sum(c)
end
Suppose I choose n = 8, c will output an array but that's not useful to me. I want to plot the polynomial, so I use sum(c) and copy and paste the output and plot it. Is there a way to call 'c' ?
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 10 月 6 日
syms x
c1 = ((2*n-1)*x*[relation(n-1),0] - (n-1)*[0,0,relation(n-2)])/n;
c=sum(c1)
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!