Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
clc
clear
disp('zad.1 wykres sin(x) i cos(x) w jednym oknie');
disp('zad.2 wykres sin(x1) i cos(x1) w osobnym oknie');
disp('zad.3 silnia dla dowolnej liczby ');
x=(-2*pi:0.2:2*pi);
x1=(-pi:0.2:pi);
y=sin(x);
y1=cos(x);
y2=sin(x1);
y3=cos(x1);
n=input('wprowadź numer zadania: ');
switch (n)
case 1
x=(-2*pi:0.2:2*pi);
y=sin(x);
y1=cos(x);
plot(x,y,'--^r',x,y1,'--*m');
xlabel('oś x')
ylabel('oś y')
text(1,1,'punkt')
legend('sin(x)','cos(x)');
title('wykresy funcji ')
grid
case 2
x1=(-pi:0.2:pi);
y2=sin(x1);
subplot(2,1,1)
plot(x1,y2,'--^r');
xlabel('oś x')
ylabel('oś y')
text(1,1,'punkt')
legend('sin(x)')
title('wykres funcji ')
grid
y3=cos(x1);
subplot(2,1,2)
plot(x1,y2,'--*m')
xlabel('oś x')
ylabel('oś y')
text(1,1,'punkt')
legend('cos(x)')
title('wykres funcji ')
grid
case 3
b=input('podaj liczbę dla której chcesz obliczyć silnie ');
silnia=1;
for k=1:1:b;
silnia=silnia*k;
end
disp(['silnia= ', num2str(silnia)]);
silnia1=1;
m=1;
while m<=b;
silnia1=silnia1*m;
m=m+1;
end
disp(['silnia1=',num2str(silnia1)]);
otherwise
disp('nie mam takiego zadania')
end
zad B
clc
clear
disp('zad.1 wykres y=2x-1 po lewej, y=x^2 po prawej');
disp('zad.2 wykres sin(x1) i cos(x1) w osobnym oknie');
disp('zad.3 suma kolejnych liczb naturalnych ');
x=(0:0.2:10);
x1=(-5:0.2:5);
y=2*x1-1;
y1=x.^2;
y2=sin(x1);
y3=cos(x1);
n=input('wprowadź numer zadania: ');
if n==1
x=(-5:0.1:5);
y=2*x-1;
y1=x.^2;
plot(x,y,'--^g',x,y1,'--rs')
ylabel('oś y')
xlabel('oś x')
text(2,1,'punkt')
legend(' y=2x-1')
legend('y=x^2')
title('wykresy funkcji')
legend('wykres y=x^2')
grid
elseif n==2
x=(0:0.2:10);
y1=2*x-1;
subplot(1,2,1)
plot(x,y1,'--^b')
ylabel('oś y')
xlabel('oś x')
text(2,1,'punkt')
legend('wykres y=2x-1')
title('wykres')
grid
x2=(-5:0.2:5);
y2=x2.^2;
subplot(1,2,2)
plot(x2,y2,'--*r')
ylabel('oś y')
xlabel('oś x')
text(2,1,'punkt')
legend('wykres y=x^2')
title('wykres')
grid
elseif n==3
n=input('podaj liczbę do sumowania ');
suma=0;
for k=1:n
suma=suma+k;
end
disp(['suma wynosi',num2str(suma)]);
m=1;
suma1=0;
while m<=n
suma1=suma1+m;
m=m+1;
end
disp(['suma1= ',num2str(suma1)]);
else
disp('brak zadania')
end
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team