Читайте также:
|
|
Санкт-Петербургский Государственный Электротехнический Университет
«ЛЭТИ»
Отчет
Лабораторная работа №16
Тема: «Графические возможности MatLab»
Выполнил: Баранов Д. А.
Факультет: ФЭА
Группа: 8403
Компьютер №18
Проверил: Пожидаев А. К.
Санкт-Петербург
Год
Задание
Освоить технику работы с основными возможностями графики MatLab для отображения функций одного, двух и трех переменных и визуализации векторных и матричных данных.
Построить графики: y=sin(x), y1=sos(x), y2=1/(cos(x)+0.1), y3=1/(sin(x)+0.1), где х изменяется от –2π до 2π в одном графическом окне.
Ход работы
Пропишем область определения функций от –2π до 2π:
>> x=[-2*pi:pi/20:2*pi]
x =
Columns 1 through 6
-6.2832 -6.1261 -5.9690 -5.8119 -5.6549 -5.4978
Columns 7 through 12
-5.3407 -5.1836 -5.0265 -4.8695 -4.7124 -4.5553
Columns 13 through 18
-4.3982 -4.2412 -4.0841 -3.9270 -3.7699 -3.6128
Columns 19 through 24
-3.4558 -3.2987 -3.1416 -2.9845 -2.8274 -2.6704
Columns 25 through 30
-2.5133 -2.3562 -2.1991 -2.0420 -1.8850 -1.7279
Columns 31 through 36
-1.5708 -1.4137 -1.2566 -1.0996 -0.9425 -0.7854
Columns 37 through 42
-0.6283 -0.4712 -0.3142 -0.1571 0 0.1571
Columns 43 through 48
0.3142 0.4712 0.6283 0.7854 0.9425 1.0996
Columns 49 through 54
1.2566 1.4137 1.5708 1.7279 1.8850 2.0420
Columns 55 through 60
2.1991 2.3562 2.5133 2.6704 2.8274 2.9845
Columns 61 through 66
3.1416 3.2987 3.4558 3.6128 3.7699 3.9270
Columns 67 through 72
4.0841 4.2412 4.3982 4.5553 4.7124 4.8695
Columns 73 through 78
5.0265 5.1836 5.3407 5.4978 5.6549 5.8119
Columns 79 through 81
5.9690 6.1261 6.2832
Значения функции y=sin(x):
>> y=sin(x)
y =
Columns 1 through 6
0.0000 0.1564 0.3090 0.4540 0.5878 0.7071
Columns 7 through 12
0.8090 0.8910 0.9511 0.9877 1.0000 0.9877
Columns 13 through 18
0.9511 0.8910 0.8090 0.7071 0.5878 0.4540
Columns 19 through 24
0.3090 0.1564 -0.0000 -0.1564 -0.3090 -0.4540
Columns 25 through 30
-0.5878 -0.7071 -0.8090 -0.8910 -0.9511 -0.9877
Columns 31 through 36
-1.0000 -0.9877 -0.9511 -0.8910 -0.8090 -0.7071
Columns 37 through 42
-0.5878 -0.4540 -0.3090 -0.1564 0 0.1564
Columns 43 through 48
0.3090 0.4540 0.5878 0.7071 0.8090 0.8910
Columns 49 through 54
0.9511 0.9877 1.0000 0.9877 0.9511 0.8910
Columns 55 through 60
0.8090 0.7071 0.5878 0.4540 0.3090 0.1564
Columns 61 through 66
0.0000 -0.1564 -0.3090 -0.4540 -0.5878 -0.7071
Columns 67 through 72
-0.8090 -0.8910 -0.9511 -0.9877 -1.0000 -0.9877
Columns 73 through 78
-0.9511 -0.8910 -0.8090 -0.7071 -0.5878 -0.4540
Columns 79 through 81
-0.3090 -0.1564 -0.0000
Значения функции y1=sos(x):
>> y1=cos(x)
y1 =
Columns 1 through 6
1.0000 0.9877 0.9511 0.8910 0.8090 0.7071
Columns 7 through 12
0.5878 0.4540 0.3090 0.1564 -0.0000 -0.1564
Columns 13 through 18
-0.3090 -0.4540 -0.5878 -0.7071 -0.8090 -0.8910
Columns 19 through 24
-0.9511 -0.9877 -1.0000 -0.9877 -0.9511 -0.8910
Columns 25 through 30
-0.8090 -0.7071 -0.5878 -0.4540 -0.3090 -0.1564
Columns 31 through 36
0.0000 0.1564 0.3090 0.4540 0.5878 0.7071
Columns 37 through 42
0.8090 0.8910 0.9511 0.9877 1.0000 0.9877
Columns 43 through 48
0.9511 0.8910 0.8090 0.7071 0.5878 0.4540
Columns 49 through 54
0.3090 0.1564 0.0000 -0.1564 -0.3090 -0.4540
Columns 55 through 60
-0.5878 -0.7071 -0.8090 -0.8910 -0.9511 -0.9877
Columns 61 through 66
-1.0000 -0.9877 -0.9511 -0.8910 -0.8090 -0.7071
Columns 67 through 72
-0.5878 -0.4540 -0.3090 -0.1564 -0.0000 0.1564
Columns 73 through 78
0.3090 0.4540 0.5878 0.7071 0.8090 0.8910
Columns 79 through 81
0.9511 0.9877 1.0000
Значения функции y2=1/(cos(x)+0.1):
>> y2=1\(cos(x)+0.1)
y2 =
Columns 1 through 6
1.1000 1.0877 1.0511 0.9910 0.9090 0.8071
Columns 7 through 12
0.6878 0.5540 0.4090 0.2564 0.1000 -0.0564
Columns 13 through 18
-0.2090 -0.3540 -0.4878 -0.6071 -0.7090 -0.7910
Columns 19 through 24
-0.8511 -0.8877 -0.9000 -0.8877 -0.8511 -0.7910
Columns 25 through 30
-0.7090 -0.6071 -0.4878 -0.3540 -0.2090 -0.0564
Columns 31 through 36
0.1000 0.2564 0.4090 0.5540 0.6878 0.8071
Columns 37 through 42
0.9090 0.9910 1.0511 1.0877 1.1000 1.0877
Columns 43 through 48
1.0511 0.9910 0.9090 0.8071 0.6878 0.5540
Columns 49 through 54
0.4090 0.2564 0.1000 -0.0564 -0.2090 -0.3540
Columns 55 through 60
-0.4878 -0.6071 -0.7090 -0.7910 -0.8511 -0.8877
Columns 61 through 66
-0.9000 -0.8877 -0.8511 -0.7910 -0.7090 -0.6071
Columns 67 through 72
-0.4878 -0.3540 -0.2090 -0.0564 0.1000 0.2564
Columns 73 through 78
0.4090 0.5540 0.6878 0.8071 0.9090 0.9910
Columns 79 through 81
1.0511 1.0877 1.1000
Значения функции y3=1/(sin(x)+0.1):
>> y3=1\(sin(x)+0.1)
y3 =
Columns 1 through 6
0.1000 0.2564 0.4090 0.5540 0.6878 0.8071
Columns 7 through 12
0.9090 0.9910 1.0511 1.0877 1.1000 1.0877
Columns 13 through 18
1.0511 0.9910 0.9090 0.8071 0.6878 0.5540
Columns 19 through 24
0.4090 0.2564 0.1000 -0.0564 -0.2090 -0.3540
Columns 25 through 30
-0.4878 -0.6071 -0.7090 -0.7910 -0.8511 -0.8877
Columns 31 through 36
-0.9000 -0.8877 -0.8511 -0.7910 -0.7090 -0.6071
Columns 37 through 42
-0.4878 -0.3540 -0.2090 -0.0564 0.1000 0.2564
Columns 43 through 48
0.4090 0.5540 0.6878 0.8071 0.9090 0.9910
Columns 49 through 54
1.0511 1.0877 1.1000 1.0877 1.0511 0.9910
Columns 55 through 60
0.9090 0.8071 0.6878 0.5540 0.4090 0.2564
Columns 61 through 66
0.1000 -0.0564 -0.2090 -0.3540 -0.4878 -0.6071
Columns 67 through 72
-0.7090 -0.7910 -0.8511 -0.8877 -0.9000 -0.8877
Columns 73 through 78
-0.8511 -0.7910 -0.7090 -0.6071 -0.4878 -0.3540
Columns 79 through 81
-0.2090 -0.0564 0.1000
Изобразим все функции на одном графике:
>> plot(x,y,x,y1,x,y2,x,y3)
Вывод
В данной работе я освоил технику работы с основными возможностями графики MatLab для отображения функций. Построил графики: y=sin(x), y1=sos(x), y2=1/(cos(x)+0.1), y3=1/(sin(x)+0.1), где х изменяется от –2π до 2π в одном графическом окне.
Дата добавления: 2015-10-16; просмотров: 52 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Задание №3 | | | Николай Александрович Добролюбов. Что такое обломовщина? |