- 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!