diff --git a/ТЕМА1/assets/Perem b/ТЕМА1/assets/Perem new file mode 100644 index 0000000..344402c --- /dev/null +++ b/ТЕМА1/assets/Perem @@ -0,0 +1,6 @@ +# Created by Octave 8.3.0, Wed Feb 11 12:35:04 2026 GMT +# name: value +# type: scalar +152 + + diff --git a/ТЕМА1/assets/Prog1.m b/ТЕМА1/assets/Prog1.m new file mode 100644 index 0000000..3089023 --- /dev/null +++ b/ТЕМА1/assets/Prog1.m @@ -0,0 +1,5 @@ +D1=D(3,5) +D2=D(3,4:end) +D3=D(2:3,3:5) +D4=D(16:20) +D5=D(3:4,[1,3,6]) diff --git a/ТЕМА1/assets/bar11.png b/ТЕМА1/assets/bar11.png new file mode 100644 index 0000000..5f21688 Binary files /dev/null and b/ТЕМА1/assets/bar11.png differ diff --git a/ТЕМА1/assets/graphic11.png b/ТЕМА1/assets/graphic11.png new file mode 100644 index 0000000..82351c5 Binary files /dev/null and b/ТЕМА1/assets/graphic11.png differ diff --git a/ТЕМА1/assets/histogram11.png b/ТЕМА1/assets/histogram11.png new file mode 100644 index 0000000..d3a265f Binary files /dev/null and b/ТЕМА1/assets/histogram11.png differ diff --git a/ТЕМА1/assets/pie11.PNG b/ТЕМА1/assets/pie11.PNG new file mode 100644 index 0000000..c7fdb32 Binary files /dev/null and b/ТЕМА1/assets/pie11.PNG differ diff --git a/ТЕМА1/assets/screen2.PNG b/ТЕМА1/assets/screen2.PNG new file mode 100644 index 0000000..6f7b80a Binary files /dev/null and b/ТЕМА1/assets/screen2.PNG differ diff --git a/ТЕМА1/assets/screen3.PNG b/ТЕМА1/assets/screen3.PNG new file mode 100644 index 0000000..1db175a Binary files /dev/null and b/ТЕМА1/assets/screen3.PNG differ diff --git a/ТЕМА1/assets/screen4.PNG b/ТЕМА1/assets/screen4.PNG new file mode 100644 index 0000000..1fa5152 Binary files /dev/null and b/ТЕМА1/assets/screen4.PNG differ diff --git a/ТЕМА1/report.md b/ТЕМА1/report.md new file mode 100644 index 0000000..9c9dbd5 --- /dev/null +++ b/ТЕМА1/report.md @@ -0,0 +1,444 @@ +# Отчет по теме 1 + +Белозёров Иван, А-03-24 + +## 1. Изучение среды GNU Octave +Запущена среда GNU Octave. Визуально изучены компоненты графического интерфейса: главное меню, командное окно, окно текущей папки, область переменных и другие элементы. + +## 2. Настройка текущего каталога +Нажал на окно рядом с *Текущая папка:* и установил путь к папке ТЕМА1: + +![Скриншот выбора текущей папки](assets/screen2.png) + + +## 3. Настройка окон интерфейса +В главном меню «Окно» отмечены галочками для отображения: +- Командное окно +- Журнал выполненных команд +- Диспетчер файлов +- Область переменных +- Редактор + +Все указанные окна появились в интерфейсе среды: +![Скриншот выбора текущей папки](assets/screen3.png) + +## 4. Установка путей и работа с файлами +В меню «Правка» + «Установить путь» добавлены пути к папкам TEMA1 и TEMA2. В окне «Диспетчер файлов» отображен список файлов текущей папки. +![Скриншот выбора текущей папки](assets/screen4.png) + +## 5. Работа со справкой +Изучена система помощи: +- Открыта документация через «Справка» + «Документация» + «На диске» +- Просмотрен GNU Octave Manual +- Проверен список пакетов через «Справка» + «Пакеты Octave» +- Использована команда `help` для получения справки по функциям + +```matlab +>> help randn +'randn' is a built-in function from the file libinterp/corefcn/rand.cc + + -- X = randn (N) + -- X = randn (M, N, ...) + -- X = randn ([M N ...]) + -- X = randn (..., "single") + -- X = randn (..., "double") + -- V = randn ("state") + -- randn ("state", V) + -- randn ("state", "reset") + -- V = randn ("seed") + -- randn ("seed", V) + -- randn ("seed", "reset") + Return a matrix with normally distributed random elements having + zero mean and variance one. + + The arguments are handled the same as the arguments for 'rand'. + + By default, 'randn' uses the Marsaglia and Tsang "Ziggurat + technique" to transform from a uniform to a normal distribution. + + The class of the value returned can be controlled by a trailing + "double" or "single" argument. These are the only valid classes. + + Reference: G. Marsaglia and W.W. Tsang, 'Ziggurat Method for + Generating Random Variables', J. Statistical Software, vol 5, 2000, + + + See also: rand, rande, randg, randp. + +Additional help for built-in functions and operators is +available in the online version of the manual. Use the command +'doc ' to search the manual index. + +Help and information about Octave is also available on the WWW +at https://www.octave.org and via the help@octave.org +mailing list. +``` + +## 6. Создание матриц и векторов +```matlab +A=randn(4,6) +A = + + -0.528329 -0.994136 0.423295 1.112417 -1.553415 0.112552 + -0.382666 1.101997 1.580713 1.707565 1.722116 -0.693864 + -0.357399 -0.131229 0.340915 -0.077007 1.373504 -0.604131 + -1.275300 0.125405 -3.324363 0.552311 -0.676089 -1.190437 + +>> B=rand(4,7) +B = + + 6.8923e-01 6.3167e-01 3.9290e-01 4.9222e-01 4.1398e-01 3.3042e-01 3.4653e-01 + 5.5290e-01 7.6563e-01 8.4603e-01 2.6433e-01 9.0435e-01 1.6311e-02 4.1257e-01 + 1.3849e-01 7.8665e-01 7.2817e-01 6.3255e-01 4.4693e-01 3.1069e-01 2.6307e-03 + 3.4252e-01 6.2507e-02 7.8017e-01 6.0083e-01 6.0237e-01 4.0533e-01 9.7884e-01 + + +>> C = 4:27 +C = + + 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 + +>> H='This is a symbols vector' +H = This is a symbols vector +>> L=[-2+23.1j, 3-5.6j] +L = + + -2.0000 + 23.1000i 3.0000 - 5.6000i +``` + +## 7. Операции с матрицами +```matlab +D=reshape(C,[],6) +D = + + 4 8 12 16 20 24 + 5 9 13 17 21 25 + 6 10 14 18 22 26 + 7 11 15 19 23 27 + +>> E=B'*A +E = + + -1.062020 -0.051115 0.074274 1.889323 -0.159865 -0.797471 + -0.987574 0.120358 1.538011 1.983992 1.375455 -1.009796 + -1.786521 0.544003 -0.841670 2.256538 1.319305 -1.911457 + -1.353524 -0.205707 -1.155552 1.282056 0.153180 -1.225409 + -1.492714 0.601927 -0.245364 2.303039 1.120912 -1.567984 + -0.808763 -0.300447 -1.075886 0.595356 -0.332495 -0.644339 + -1.590215 0.232552 -2.454290 1.630394 -0.485993 -1.414100 + +>> F=[A,B] +F = + + Columns 1 through 10: + + -5.2833e-01 -9.9414e-01 4.2330e-01 1.1124e+00 -1.5534e+00 1.1255e-01 6.8923e-01 6.3167e-01 3.9290e-01 4.9222e-01 + -3.8267e-01 1.1020e+00 1.5807e+00 1.7076e+00 1.7221e+00 -6.9386e-01 5.5290e-01 7.6563e-01 8.4603e-01 2.6433e-01 + -3.5740e-01 -1.3123e-01 3.4092e-01 -7.7007e-02 1.3735e+00 -6.0413e-01 1.3849e-01 7.8665e-01 7.2817e-01 6.3255e-01 + -1.2753e+00 1.2540e-01 -3.3244e+00 5.5231e-01 -6.7609e-01 -1.1904e+00 3.4252e-01 6.2507e-02 7.8017e-01 6.0083e-01 + + Columns 11 through 13: + + 4.1398e-01 3.3042e-01 3.4653e-01 + 9.0435e-01 1.6311e-02 4.1257e-01 + 4.4693e-01 3.1069e-01 2.6307e-03 + 6.0237e-01 4.0533e-01 9.7884e-01 + +>> G=A.*D +G = + + -2.1133 -7.9531 5.0795 17.7987 -31.0683 2.7012 + -1.9133 9.9180 20.5493 29.0286 36.1644 -17.3466 + -2.1444 -1.3123 4.7728 -1.3861 30.2171 -15.7074 + -8.9271 1.3795 -49.8654 10.4939 -15.5500 -32.1418 + +>> M=G./4.5 +M = + + -0.4696 -1.7674 1.1288 3.9553 -6.9041 0.6003 + -0.4252 2.2040 4.5665 6.4508 8.0365 -3.8548 + -0.4765 -0.2916 1.0606 -0.3080 6.7149 -3.4905 + -1.9838 0.3065 -11.0812 2.3320 -3.4556 -7.1426 + +>> DDD=D.^3 +DDD = + + 64 512 1728 4096 8000 13824 + 125 729 2197 4913 9261 15625 + 216 1000 2744 5832 10648 17576 + 343 1331 3375 6859 12167 19683 + +>> DL=D>=20 +DL = + + 0 0 0 0 1 1 + 0 0 0 0 1 1 + 0 0 0 0 1 1 + 0 0 0 0 1 1 + +>> Dstolb=D(:) +Dstolb = + + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 +``` + +## 8. Стандартные функции +```matlab +B1=sqrt(B) +B1 = + + 0.830196 0.794780 0.626818 0.701587 0.643416 0.574820 0.588671 + 0.743569 0.875002 0.919798 0.514131 0.950974 0.127716 0.642313 + 0.372137 0.886932 0.853329 0.795333 0.668526 0.557392 0.051291 + 0.585250 0.250013 0.883270 0.775134 0.776123 0.636652 0.989364 + +>> B2=log(B) +B2 = + + -0.372186 -0.459381 -0.934198 -0.708822 -0.881929 -1.107396 -1.059777 + -0.592586 -0.267058 -0.167202 -1.330552 -0.100537 -4.115892 -0.885359 + -1.976984 -0.239973 -0.317219 -0.457989 -0.805361 -1.168973 -5.940491 + -1.071431 -2.772484 -0.248248 -0.509438 -0.506889 -0.903063 -0.021386 + +>> B3=sin(B) +B3 = + + 6.3594e-01 5.9050e-01 3.8287e-01 4.7259e-01 4.0226e-01 3.2444e-01 3.3964e-01 + 5.2515e-01 6.9299e-01 7.4865e-01 2.6126e-01 7.8602e-01 1.6311e-02 4.0096e-01 + 1.3804e-01 7.0799e-01 6.6551e-01 5.9121e-01 4.3220e-01 3.0571e-01 2.6307e-03 + 3.3586e-01 6.2466e-02 7.0340e-01 5.6533e-01 5.6659e-01 3.9432e-01 8.2985e-01 + +>> k=length(B1) +k = 7 +>> nm=size(B1) +nm = + + 4 7 + +>> elem=numel(B1) +elem = 28 +>> NN=linspace(11.5,34.1,20) +NN = + + Columns 1 through 14: + + 11.500 12.689 13.879 15.068 16.258 17.447 18.637 19.826 21.016 22.205 23.395 24.584 25.774 26.963 + + Columns 15 through 20: + + 28.153 29.342 30.532 31.721 32.911 34.100 + +>> FF=ones(2,4) +FF = + + 1 1 1 1 + 1 1 1 1 + +>> GG=zeros(5) +GG = + + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + +>> B1D=diag(B1) +B1D = + + 0.8302 + 0.8750 + 0.8533 + 0.7751 + +>> DB=diag(B1D) +DB = + +Diagonal Matrix + + 0.8302 0 0 0 + 0 0.8750 0 0 + 0 0 0.8533 0 + 0 0 0 0.7751 + +>> BS1=sort(B) +BS1 = + + 1.3849e-01 6.2507e-02 3.9290e-01 2.6433e-01 4.1398e-01 1.6311e-02 2.6307e-03 + 3.4252e-01 6.3167e-01 7.2817e-01 4.9222e-01 4.4693e-01 3.1069e-01 3.4653e-01 + 5.5290e-01 7.6563e-01 7.8017e-01 6.0083e-01 6.0237e-01 3.3042e-01 4.1257e-01 + 6.8923e-01 7.8665e-01 8.4603e-01 6.3255e-01 9.0435e-01 4.0533e-01 9.7884e-01 + +>> BS2=sortrows(B,2) +BS2 = + + 3.4252e-01 6.2507e-02 7.8017e-01 6.0083e-01 6.0237e-01 4.0533e-01 9.7884e-01 + 6.8923e-01 6.3167e-01 3.9290e-01 4.9222e-01 4.1398e-01 3.3042e-01 3.4653e-01 + 5.5290e-01 7.6563e-01 8.4603e-01 2.6433e-01 9.0435e-01 1.6311e-02 4.1257e-01 + 1.3849e-01 7.8665e-01 7.2817e-01 6.3255e-01 4.4693e-01 3.1069e-01 2.6307e-03 + +>> DS1=sum(D) +DS1 = + + 22 38 54 70 86 102 + +>> DS2=sum(D,2) +DS2 = + + 84 + 90 + 96 + 102 + +>> DP1=prod(D) +DP1 = + + 840 7920 32760 93024 212520 421200 + +>> dt=det(A*A') +dt = 727.40 +>> dinv=inv(A*A') +dinv = + + 0.283810 -0.061584 0.278944 -0.011754 + -0.061584 0.190474 -0.271478 0.037051 + 0.278944 -0.271478 0.932179 -0.026774 + -0.011754 0.037051 -0.026774 0.076090 +``` + +## 9. Работа с индексацией элементов матриц +```matlab +D1=D(3,5) +D1 = 22 +>> D2=D(3,4:end) +D2 = + + 18 22 26 + +>> D3=D(2:3,3:5) +D3 = + + 13 17 21 + 14 18 22 + +>> D4=D(16:20) +D4 = + + 19 20 21 22 23 + +>> D5=D(3:4,[1,3,6]) +D5 = + + 6 14 26 + 7 15 27 +``` + +## 10. Управляющие конструкции +```matlab +Dsum=0 +Dsum = 0 +>> for i=1:6 +Dsum=Dsum+sqrt(D(2,i))\ +endfor +Dsum = 2.2361 +Dsum = 5.2361 +Dsum = 8.8416 +Dsum = 12.965 +Dsum = 17.547 +Dsum = 22.547 +>> Dsum2=0;i=1 +i = 1 +>> while (D(i)<22) +Dsum2=Dsum2+sin(D(i)) +i=i+1 +endwhile +Dsum2 = -0.7568 +i = 2 +Dsum2 = -1.7157 +i = 3 +Dsum2 = -1.9951 +i = 4 +Dsum2 = -1.3382 +i = 5 +Dsum2 = -0.3488 +i = 6 +Dsum2 = 0.063321 +i = 7 +Dsum2 = -0.4807 +i = 8 +Dsum2 = -1.4807 +i = 9 +Dsum2 = -2.0173 +i = 10 +Dsum2 = -1.5971 +i = 11 +Dsum2 = -0.6065 +i = 12 +Dsum2 = 0.043799 +i = 13 +Dsum2 = -0.2441 +i = 14 +Dsum2 = -1.2055 +i = 15 +Dsum2 = -1.9565 +i = 16 +Dsum2 = -1.8066 +i = 17 +Dsum2 = -0.8937 +i = 18 +Dsum2 = -0.057011 +i = 19 +>> if (D(3,5)>=20) +printf('D(3,5)>=20') +else +printf('D(3,5)<20') +endif +D(3,5)>=20>> +``` + +## 11. Графические функции +```matlab +>> graphics_toolkit('gnuplot') +>> plot(D(1,:),B([2,4],1:6)) +>> +>> hist(A(:),6) +>> +>> +>> pie(D(1,:)) + + +>> bar(D(1,:)) +``` +![график](assets/graphic11.png) +![гистограмма](assets/histogram11.png) +![круговая диаграмма](assets/pie11.png) +![ступенчатая диаграмма](assets/bar11.png) + +## 12. Работа с текстовым редактором +Создан файл Prog1.m с командами из пункта 9. Файл сохранен в папке TEMA1/assets. Программа успешно запущена как через клавишу F5, так и через ввод имени файла в командной строке. + +## 13. Сохранение и загрузка переменных +Содержимое области переменных сохранено в файл Perem. После перезапуска среды и установки пути к папке TEMA1 переменные успешно загружены из файла Perem. Команды из предыдущего сеанса отображены в журнале выполненных команд. \ No newline at end of file diff --git a/ТЕМА1/task.md b/ТЕМА1/task.md new file mode 100644 index 0000000..e69de29