How do i delete red box?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ann Lee
am 1 Apr. 2022
Kommentiert: Star Strider
am 1 Apr. 2022
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 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Apr. 2022
You forgot one semicolon.
That is the one following the function call itself:
A=work5(x);
Add it, and the problem should be resolved.
.
2 Kommentare
Weitere Antworten (1)
Voss
am 1 Apr. 2022
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 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!