카테고리
Legacy Roomlegacy-room
코드와 해설을 함께 읽는 학습 문서
Code Detail
Signal Processing + Visualization 중심의 Octave 학습 예제
oc ex/startup.m
코드를 복사해 Octave에서 바로 실행할 수 있습니다.
43 lines
% startup.m 파일은 프로젝트 루트에 위치한다.
% startup.m 세션이 시작할 떄 가장 먼저 자동으로 실행된다.
% 메인 코드에서 clear all 하면 pkg는 무효화되고 default param은 유지된다.
clc; clear all; close all;
addpath(genpath(pwd));
pkg load io
pkg load signal
fontsize = 16;
% Position
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];
% figure
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, "defaultAxesNextPlot", "add");
# set(0, "defaultAxesColorOrder", color_base);
% plot
# set(0, "defaultLineLineWidth", 1.2);
% text
set(0, "defaultTextFontSize", fontsize);