NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

zad1 wprowadzenie wartości liczbowej n
=============================
clc
clear
n=input('Podaj liczbę n: ');
if mod(n,2)==0
disp('Jest to liczba parzysta')
elseif mod(n,2)==1
disp('Liczba nieparzysta')
else
disp('Nie podałeś liczby całkowitej')
end
save('pliku.txt','-ascii','n')
clear
a=load('pliku.txt','n');
if a<0 || a>170
disp('Nie można obliczyć silni dla tej wartości')
else
if mod(a,2)==0
s=1;
disp(['Silnia jest obliczana dla wartości: ',num2str(a),' za pomocą pętli for-end, warunek nie był spełniony dla pętli while-end'])
for i=1:a
s=s*i;
end

disp(['Silnia n wynosi: ',num2str(s)])
elseif mod(a,2)==1
disp(['Silnia jest obliczana dla wartości: ',num2str(a),' za pomocą pętli while-end, warunek nie był spełniony dla pętli for-end'])
s1=1;
x=1;
while x<a
x=x+1;
s1=s1*x;
end

disp(['Silnia n wynosi: ',num2str(s1)])
else
end
end

zad2 radiany stopnie
========================
clc
clear
%1)
n=input('Wprowadź 1)- jeśli funkcja ma być wyświetlana w radianach, 2)-jeśli funkcja ma być wyświetlana w stopniach');
%2)
a=input('Podaj przedział funkcji od: ');
b=input('Podaj wartość funkcji do: ');
while b<=a
disp('Przedział funkcji od musi być mniejszy od przedziału do')
a=input('Podaj przedział funkcji od: ');
b=input('Podaj wartość funkcji do: ');
end
%3)
if n==1
x=pi()*a:0.1:pi()*b;
y1=sin(x);
y2=cos(x);
plot(x,y1,'g',x,y2,'r')
xlabel('x')
ylabel('y')
title('Wykres funkcji sin(x) i cos(x) dla radianów')
legend('sin(x)','cos(x)')
grid on
A=input('Podaj stałą A: ');
while A<=0 || A>8
disp('Nieprawidłowa wartość A')
A=input('Podaj stałą A: ');
end
y3=A*cos(x);
y4=A*sin(x);
plot(x,y3,'k',x,y4,'b',x,y1,'g',x,y2,'r')
xlabel('x')
ylabel('y')
title('Wykres funkcji A*sin(x) i A*cos(x) dla radianów')
legend('A*sin(x)','A*cos(x)','sin(x)','cos(x)')
grid on
elseif n==2
x=a:0.1:b;
y1=sind(x);
y2=cosd(x);
plot(x,y1,'g',x,y2,'r')
xlabel('x')
ylabel('y')
title('Wykres funkcji sin(x) i cos(x) dla stopni')
legend('sin(x)','cos(x)')
grid on
A=input('Podaj stałą A: ');
while A<=0 || A>8
disp('Nieprawidłowa wartość A')
A=input('Podaj stałą A: ');
end
y3=A*cosd(x);
y4=A*sind(x);
plot(x,y3,'k',x,y4,'b',x,y1,'g',x,y2,'r')
xlabel('x')
ylabel('y')
title('Wykres funkcji A*sin(x) i A*cos(x) dla stopni')
legend('A*sin(x)','A*cos(x)','sin(x)','cos(x)')
grid on
else
disp('wybrałeś złą liczbę')
end

Zad3 wektor o 3 elementach
============================
clc
clear
W1=[1 2 3];
disp(['W1 = ',num2str(W1)])
u=input('Podaj pierwszy element wektora W2: ');
while u<=0
disp('Wartości wektora muszą być większe od zera')
u=input('Podaj pierwszy element wektora W2: ');
end
b=input('Podaj drugi element wektora W2: ');
while b<=0
disp('Wartości wektora muszą być większe od zera')
b=input('Podaj pierwszy element wektora W2: ');
end
c=input('Podaj drugi element wektora W2: ');
while c<=0
disp('Wartości wektora muszą być większe od zera')
c=input('Podaj pierwszy element wektora W2: ');
end
W2=[u b c];
disp(['W2 = ',num2str(W2)])
x=length(W1);
y=min(W2);
save('promien.txt','-ascii','x')
save('bok.txt','-ascii','y')
clear
r=load('promien.txt','x');
a=load('bok.txt','y');
[objk,powk,objsz,powsz]=zadanie3(r,a);
disp(['Objętość kuli wynosi: ',num2str(objk)])
disp(['Pole kuli wynosi: ',num2str(powk)])
disp(['Objętość sześcianu wynosi: ',num2str(objsz)])
disp(['Pole sześcianu wynosi: ',num2str(powsz)])
     
 
what is notes.io
 

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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.