- 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 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
(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 commentaires
Réponses (2)
Image Analyst
le 10 Avr 2022
Modifié(e) : Image Analyst
le 10 Avr 2022
"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 commentaires
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!