- For one, you're requiring an x input argument but you never use it.
- n is not defined so f(n) will throw an error.
- f was not defined in advance to f(n)= sum(exp(ln(f(n)))); will fail because you try to use f before it's assigned.
how do i print my conversion code?
1 回表示 (過去 30 日間)
古いコメントを表示
(factorial(n))/(n.^n);
this series is divergence over n being over 170.
and i want to make this series being converges when n being over 1000.
to make converges,
i conversed of expression to 'exp(ln(f(x))) = f(x)'
i want to print when n= 170~1000, this series( 'exp(ln(f(n))) = f(n)' )'s sum and
find the result of sum is converges or divergence
and print sum of series's graph
how can i fix this code?
and can i know what should i type on my command window to print out graph?
function A=work5(x)
m=1;
y = 170:10:1000;
for k = y
n=1:k;
f(n)= sum(exp(ln(f(n))));
A(1,m)=f(n);
m=m+1;
end
fprintf('k-sum\t\t%-10s\n','series a)','C or D');
fprintf('%-d-sum\t\t%13.10f\t%13.10f\t%13.10f\n',[y; A]);
end
0 件のコメント
回答 (2 件)
Image Analyst
2022 年 4 月 10 日
編集済み: Image Analyst
2022 年 4 月 10 日
"what should i type on my command window to print out graph?".......
On the figure toolbar there should be a printer icon. Try using that.
Or, you can use exportgraphics() to save your plot to a file, and then use your operating system to print the image file just like you would for any image.
Or try
printdlg(gcf)
As far as the function itself, there is lots wrong with it.
There may possibly be more problems once you fix those problems.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Printing and Saving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!