How do i delete red box?
2 ビュー (過去 30 日間)
古いコメントを表示
is there any solution to not showing that red box?
i tried type ; every last of sentences and i couldnt find..
function A=work5(x)
m=1;
fun =@(n) log(n)./(n.^2);
fun2 =cube=@(n)(factorial(n))/(n.^n);
y = 10:10:160;
for k = y
n=1:k;
a= sum(nthroot(n.^2,5)./((3.^n).*(n+1)));
A(1,m)=a;
a= sum((3*n.^2+n)/(2*n.^4+nthroot(n,2)));
A(2,m)=a;
a= sum((nthroot(37,2)*n.^3)/((2*n.^3)+(3*n.^2)));
A(3,m)=a;
a=sum(fun(n));
A(4,m)=a;
a=sum(fun(n));
A(5,m)=a;
m=m+1;
end
fprintf('k-sum\t\t%-10s\t%-10s\t%-10s\t%-10s\t%-10s\n','series a)',' series b)',' series c)',' series d)',' series e)');
fprintf('%-d-sum\t\t%18.16f\t%18.16f\t%18.16f\t%18.16f\t%18.16f\n',[y; A]);
end
0 件のコメント
採用された回答
Star Strider
2022 年 4 月 1 日
You forgot one semicolon.
That is the one following the function call itself:
A=work5(x);
Add it, and the problem should be resolved.
.
その他の回答 (1 件)
Voss
2022 年 4 月 1 日
Put a semicolon at the end of the line where you call work5()
x = 0.5;
A=work5(x); % semicolon here to suppress output
function A=work5(x)
m=1;
fun =@(n) log(n)./(n.^2);
% fun2 =cube=@(n)(factorial(n))/(n.^n);
y = 10:10:160;
for k = y
n=1:k;
a= sum(nthroot(n.^2,5)./((3.^n).*(n+1)));
A(1,m)=a;
a= sum((3*n.^2+n)/(2*n.^4+nthroot(n,2)));
A(2,m)=a;
a= sum((nthroot(37,2)*n.^3)/((2*n.^3)+(3*n.^2)));
A(3,m)=a;
a=sum(fun(n));
A(4,m)=a;
a=sum(fun(n));
A(5,m)=a;
m=m+1;
end
fprintf('k-sum\t\t%-10s\t%-10s\t%-10s\t%-10s\t%-10s\n','series a)',' series b)',' series c)',' series d)',' series e)');
fprintf('%-d-sum\t\t%18.16f\t%18.16f\t%18.16f\t%18.16f\t%18.16f\n',[y; A]);
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Financial Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!