How do you store all k values as a single array?
for ii = nn
k = ((-1).^(ii-1)).*((xx^(2.*(ii-1))))./(factorial(2.*(ii-1)));
end

 採用された回答

per isakson
per isakson 2017 年 10 月 26 日
編集済み: per isakson 2017 年 10 月 26 日

0 投票

There are a couple of mistakes in your code. Try this
k = nan( 1, nn ); % pre-alloctate memory
for ii = 1 : nn
k(ii) = ((-1).^(ii-1)).*((xx^(2.*(ii-1))))./(factorial(2.*(ii-1)));
end
assert( all(not(isnan(k))) )

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2017 年 10 月 26 日

編集済み:

2017 年 10 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by