Ich versuche, eine Skriptdatei mit verschiedenen Skriptzellen darin zu erstellen, getrennt durch %%
. Der folgende Code gibt eine alte Zahl und einen Kreis zurück. Ich möchte jedoch das Zahlenfenster löschen, sodass ich nur eine Zahl erhalte, wenn ich ein bestimmtes Skript ausführe.Matlab. Eine Skriptzelle gibt zwei Zahlen zurück
% Rita tan(x)
x=((-pi/2)+0.01:0.01:(pi/2)-0.01);
y=tan(x);
plot(x,y)
grid on
%%
% Exempel 1
x=linspace(0,8);
y=x.*sin(x);
plot(x,y)
title('f(x)=sin(x)')
%%
% Plot circle
t=linspace(0,2*pi);
x=cos(t); y=sin(t);
subplot(1,2,1)
plot(x,y)
title('Utan axis equal')
subplot(1,2,2)
plot(x,y)
axis equal
title('Med axis equal')
%%
% Funktionsytor
x=linspace(0,5,50);
y=linspace(0,5,50);
[X,Y]= meshgrid(x,y);
F=X.*cos(2*X).*sin(Y);
surf(X,Y,F)
%%
Was ich erhalte, ist:
Wie bekomme ich nur einer von ihnen?
Oh Gott ... Ich habe RUN anstatt RUN SECTION gedrückt ... Es tut mir so leid ... aber vielen Dank für die Codes, es hat mir wirklich sehr geholfen, Kumpel. Es wird spät... – Parseval