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!