카테고리
Course Optimizationcourse-optim
코드와 해설을 함께 읽는 학습 문서
Code Detail
Signal Processing + Control & Dynamics 중심의 Octave 학습 예제
course/optim/startup.m
코드를 복사해 Octave에서 바로 실행할 수 있습니다.
59 lines
clc; clear all; close all;
pkg load io
pkg load signal
# pkg load statistics
pkg load image
pkg load optim
pkg load splines
# pkg load control
# pkg load symbolic
# 환경변수에 colored 함수 사용 가능함을 기록함
# strcmp(getenv("COLORTEXT"), "true") % 사용할 떄
setenv("COLORTEXT", "true"); % 기록할 때
printf(fmt("{mfilename} local - project\n", "#FF5733"));
fontsize = 14;
color_base = [
hex2color("#69A1FA"), % 파란색
hex2color("#CF87DA"), % 보라색
hex2color("#00CC6A"), % 녹색
hex2color("#FADB79"), % 노란색
hex2color("#5678C5"), % 조금 더 진한 파란색
hex2color("#A84AC5"), % 깊은 보라색
hex2color("#00B85A"), % 진한 녹색
hex2color("#E5C441"), % 진한 노란색
hex2color("#508BD1"), % 회색이 섞인 파란색
hex2color("#9A59D7") % 고급스러운 보라색
];
% figure
screenSize = get(0, "ScreenSize"); % [x y width height]
screenWidth = screenSize(3);
screenHeight = screenSize(4);
windowWidth = floor(screenWidth / 3);
windowHeight = floor(screenHeight / 3);
left = (screenWidth - windowWidth) / 2;
bottom = (screenHeight - windowHeight) / 2;
position = [left, bottom, windowWidth, windowHeight];
set(0, "defaultFigurePosition", position);
set(0, "defaultFigureName", "Figure");
set(0, "defaultFigureColor", "#FFFFFF");
set(0, "defaultFigureNumberTitle", "off");
% axes
set(0, "defaultAxesFontSize", fontsize);
set(0, "defaultAxesLineWidth", 0.5);
set(0, "defaultAxesXGrid", "on");
set(0, "defaultAxesYGrid", "on");
set(0, "defaultAxesZGrid", "on");
set(0, "defaultAxesColorOrder", color_base);
set(0, "defaultAxesNextPlot", "add");
% text
set(0, "defaultTextFontSize", fontsize);