Created
December 16, 2016 20:57
-
-
Save Zulcom/f6dae4c907b8e8aab943973c0416765c to your computer and use it in GitHub Desktop.
NSTU inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y = 0.3; | |
z = 3.8; | |
xvec = -1:0.3:2; % промежуток х | |
R = 0; % это временная переменная, здесь будем считать R для каждого аргумента | |
Rvec = []; % здесь храним значения функций. | |
for x = xvec %пробегаем по промежутку хvec, при этом каждый элемент предатсавляя как х | |
if y>x | |
R= (z*cos(z))/exp(x+y) + atan(power(1+z*z,1/3)); | |
else | |
product = 1; | |
k=1; | |
while k<=5 | |
product = product * k/(1+k); | |
k=k+1; | |
end | |
R = product + cosh(y+z)/(x-y+5); | |
end | |
Rvec(end+1)=R; % добавляем новое значение функции | |
end | |
plot(xvec,Rvec,'.'); % строим график значение-аргумент, каждую найденную точку обозачаем знаком '.'. | |
%Если надо построить просто линию, использовать plot(xvec,Rvec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment