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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/949409/image.jpeg)
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 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!