CINXE.COM
Matlab/스크립트 - 위키배움터
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="ko" dir="ltr"> <head> <meta charset="UTF-8"> <title>Matlab/스크립트 - 위키배움터</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )kowikiversitymwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"ko","wgMonthNames":["","1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],"wgRequestId":"bd91a0dc-a77e-4e45-b6b3-4d2367943b55","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Matlab/스크립트","wgTitle":"Matlab/스크립트","wgCurRevisionId":32996,"wgRevisionId":32996,"wgArticleId":3425,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["구식 source 태그를 사용하는 문서","진행 중인 자료","대학 수준"],"wgPageViewLanguage":"ko","wgPageContentLanguage":"ko","wgPageContentModel":"wikitext","wgRelevantPageName":"Matlab/스크립트","wgRelevantArticleId":3425,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikiversity","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault": true,"wgVisualEditor":{"pageLanguageCode":"ko","pageLanguageDir":"ltr","pageVariantFallbacks":"ko"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":10000,"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","ext.cite.styles":"ready","ext.math.styles":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready", "ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","ext.cite.ux-enhancements","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.directcommons","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=ko&modules=ext.cite.styles%7Cext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=ko&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Matlab/스크립트 - 위키배움터"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//ko.m.wikiversity.org/wiki/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8"> <link rel="alternate" type="application/x-wiki" title="편집" href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit"> <link rel="icon" href="/static/favicon/wikiversity.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="위키배움터 (ko)"> <link rel="EditURI" type="application/rsd+xml" href="//ko.wikiversity.org/w/api.php?action=rsd"> <link rel="canonical" href="https://ko.wikiversity.org/wiki/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.ko"> <link rel="alternate" type="application/atom+xml" title="위키배움터 아톰 피드" href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EC%B5%9C%EA%B7%BC%EB%B0%94%EB%80%9C&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Matlab_스크립트 rootpage-Matlab skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">본문으로 이동</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="사이트"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="주 메뉴" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">주 메뉴</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">주 메뉴</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">사이드바로 이동</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">숨기기</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> 둘러보기 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EB%8C%80%EB%AC%B8" title="대문으로 가기 [z]" accesskey="z"><span>대문</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EC%B5%9C%EA%B7%BC%EB%B0%94%EB%80%9C" title="위키의 최근 바뀐 목록 [r]" accesskey="r"><span>최근 바뀜</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EC%9E%84%EC%9D%98%EB%AC%B8%EC%84%9C" title="무작위로 선택된 문서 불러오기 [x]" accesskey="x"><span>임의의 문서로</span></a></li> </ul> </div> </div> <div id="p-편집_안내" class="vector-menu mw-portlet mw-portlet-편집_안내" > <div class="vector-menu-heading"> 편집 안내 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-정책과-지침" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%A0%95%EC%B1%85%EA%B3%BC_%EC%A7%80%EC%B9%A8"><span>정책과 지침</span></a></li><li id="n-help" class="mw-list-item"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" title="도움말"><span>도움말</span></a></li><li id="n-편집-질문방" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%A7%88%EB%AC%B8%EB%B0%A9"><span>편집 질문방</span></a></li> </ul> </div> </div> <div id="p-사용자_모임" class="vector-menu mw-portlet mw-portlet-사용자_모임" > <div class="vector-menu-heading"> 사용자 모임 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%82%AC%EB%9E%91%EB%B0%A9" title="프로젝트에 대해 여러분이 할 수 있고, 정보를 찾을 수 있는 곳"><span>사랑방</span></a></li><li id="n-검토-토론" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EA%B2%80%ED%86%A0_%ED%86%A0%EB%A1%A0"><span>검토 토론</span></a></li><li id="n-관리인-요청" class="mw-list-item"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EA%B4%80%EB%A6%AC%EC%9D%B8_%EC%9A%94%EC%B2%AD"><span>관리인 요청</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EB%8C%80%EB%AC%B8" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikiversity.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="위키배움터" src="/static/images/mobile/copyright/wikiversity-wordmark-ko.svg" style="width: 7.5em; height: 1.3125em;"> <img class="mw-logo-tagline" alt="" src="/static/images/mobile/copyright/wikiversity-tagline-ko.svg" width="120" height="17" style="width: 7.5em; height: 1.0625em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/%ED%8A%B9%EC%88%98:%EA%B2%80%EC%83%89" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="위키배움터 검색 [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>검색</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="위키배움터 검색" aria-label="위키배움터 검색" autocapitalize="sentences" title="위키배움터 검색 [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="특수:검색"> </div> <button class="cdx-button cdx-search-input__end-button">검색</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="개인 도구"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="보이기"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="문서의 글꼴 크기, 폭, 색의 모습을 변경합니다" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="보이기" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">보이기</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=ko.wikiversity.org&uselang=ko" class=""><span>기부</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EA%B3%84%EC%A0%95%EB%A7%8C%EB%93%A4%EA%B8%B0&returnto=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="계정을 만들고 로그인하는 것이 좋습니다. 하지만 필수는 아닙니다" class=""><span>계정 만들기</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EB%A1%9C%EA%B7%B8%EC%9D%B8&returnto=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="꼭 로그인해야 하는 것은 아니지만, 로그인을 권장합니다. [o]" accesskey="o" class=""><span>로그인</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="더 많은 옵션" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="개인 도구" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">개인 도구</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="사용자 메뉴" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=ko.wikiversity.org&uselang=ko"><span>기부</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EA%B3%84%EC%A0%95%EB%A7%8C%EB%93%A4%EA%B8%B0&returnto=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="계정을 만들고 로그인하는 것이 좋습니다. 하지만 필수는 아닙니다"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>계정 만들기</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EB%A1%9C%EA%B7%B8%EC%9D%B8&returnto=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="꼭 로그인해야 하는 것은 아니지만, 로그인을 권장합니다. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>로그인</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> 로그아웃한 편집자를 위한 문서 <a href="/wiki/%EB%8F%84%EC%9B%80%EB%A7%90:%EC%86%8C%EA%B0%9C" aria-label="편집에 관해 더 알아보기"><span>더 알아보기</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EB%82%B4%EA%B8%B0%EC%97%AC" title="이 IP 주소의 편집 목록 [y]" accesskey="y"><span>기여</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EB%82%B4%EC%82%AC%EC%9A%A9%EC%9E%90%ED%86%A0%EB%A1%A0" title="현재 사용하는 IP 주소에 대한 토론 문서 [n]" accesskey="n"><span>토론</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="사이트"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="목차" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">목차</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">사이드바로 이동</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">숨기기</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">처음 위치</div> </a> </li> <li id="toc-스크립트_작성과_실행" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#스크립트_작성과_실행"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>스크립트 작성과 실행</span> </div> </a> <ul id="toc-스크립트_작성과_실행-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-input" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#input"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>input</span> </div> </a> <ul id="toc-input-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-disp" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#disp"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>disp</span> </div> </a> <ul id="toc-disp-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-fprintf" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#fprintf"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>fprintf</span> </div> </a> <button aria-controls="toc-fprintf-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>fprintf 하위섹션 토글하기</span> </button> <ul id="toc-fprintf-sublist" class="vector-toc-list"> <li id="toc-fprintf를_이용해_출력_값_저장하기" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#fprintf를_이용해_출력_값_저장하기"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>fprintf를 이용해 출력 값 저장하기</span> </div> </a> <ul id="toc-fprintf를_이용해_출력_값_저장하기-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-관계_연산자" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#관계_연산자"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>관계 연산자</span> </div> </a> <ul id="toc-관계_연산자-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-논리_연산자" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#논리_연산자"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>논리 연산자</span> </div> </a> <ul id="toc-논리_연산자-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-조건문" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#조건문"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>조건문</span> </div> </a> <ul id="toc-조건문-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-반복문" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#반복문"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>반복문</span> </div> </a> <button aria-controls="toc-반복문-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>반복문 하위섹션 토글하기</span> </button> <ul id="toc-반복문-sublist" class="vector-toc-list"> <li id="toc-for-end" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#for-end"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.1</span> <span>for-end</span> </div> </a> <ul id="toc-for-end-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-while-end" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#while-end"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.2</span> <span>while-end</span> </div> </a> <ul id="toc-while-end-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-사용자_정의_함수" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#사용자_정의_함수"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>사용자 정의 함수</span> </div> </a> <ul id="toc-사용자_정의_함수-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-feval" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#feval"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>feval</span> </div> </a> <ul id="toc-feval-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-익명함수" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#익명함수"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>익명함수</span> </div> </a> <ul id="toc-익명함수-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-각주" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#각주"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>각주</span> </div> </a> <ul id="toc-각주-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-참고_자료" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#참고_자료"> <div class="vector-toc-text"> <span class="vector-toc-numb">13</span> <span>참고 자료</span> </div> </a> <ul id="toc-참고_자료-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="목차" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="목차 토글" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">목차 토글</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Matlab/스크립트</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="이 문서는 이 언어로만 존재합니다. 다른 언어로 문서를 추가하세요" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-0" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">언어 추가</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="uls-after-portlet-link"></span><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:NewItem?site=kowikiversity&page=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="언어 간 링크 추가" class="wbc-editpage">링크 추가</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="이름공간"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="본문 보기 [c]" accesskey="c"><span>문서</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%ED%86%A0%EB%A1%A0:Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&redlink=1" rel="discussion" class="new" title="문서의 내용에 대한 토론 문서 (없는 문서) [t]" accesskey="t"><span>토론</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="언어 변종 바꾸기" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">한국어</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="보기"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8"><span>읽기</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit" title="이 문서 편집하기 [e]" accesskey="e"><span>편집</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=history" title="문서의 과거 판 [h]" accesskey="h"><span>역사 보기</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="페이지 도구"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="도구" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">도구</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">도구</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">사이드바로 이동</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">숨기기</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="더 많은 옵션" > <div class="vector-menu-heading"> 동작 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8"><span>읽기</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit" title="이 문서 편집하기 [e]" accesskey="e"><span>편집</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=history"><span>역사 보기</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> 일반 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EA%B0%80%EB%A6%AC%ED%82%A4%EB%8A%94%EB%AC%B8%EC%84%9C/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="여기를 가리키는 모든 위키 문서의 목록 [j]" accesskey="j"><span>여기를 가리키는 문서</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%EB%A7%81%ED%81%AC%EC%B5%9C%EA%B7%BC%EB%B0%94%EB%80%9C/Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" rel="nofollow" title="이 문서에서 링크한 문서의 최근 바뀜 [k]" accesskey="k"><span>가리키는 글의 최근 바뀜</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=ko" title="파일 올리기 [u]" accesskey="u"><span>파일 올리기</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/%ED%8A%B9%EC%88%98:%ED%8A%B9%EC%88%98%EB%AC%B8%EC%84%9C" title="모든 특수 문서의 목록 [q]" accesskey="q"><span>특수 문서 목록</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&oldid=32996" title="이 문서의 이 판에 대한 고유 링크"><span>고유 링크</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=info" title="이 문서에 대한 자세한 정보"><span>문서 정보</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EC%9D%B4%EB%AC%B8%EC%84%9C%EC%9D%B8%EC%9A%A9&page=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&id=32996&wpFormIdentifier=titleform" title="이 문서를 인용하는 방법에 대한 정보"><span>이 문서 인용하기</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:UrlShortener&url=https%3A%2F%2Fko.wikiversity.org%2Fwiki%2FMatlab%2F%25EC%258A%25A4%25ED%2581%25AC%25EB%25A6%25BD%25ED%258A%25B8"><span>축약된 URL 얻기</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:QrCode&url=https%3A%2F%2Fko.wikiversity.org%2Fwiki%2FMatlab%2F%25EC%258A%25A4%25ED%2581%25AC%25EB%25A6%25BD%25ED%258A%25B8"><span>QR 코드 다운로드</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> 인쇄/내보내기 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:%EC%B1%85&bookcmd=book_creator&referer=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8"><span>책 만들기</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=%ED%8A%B9%EC%88%98:DownloadAsPdf&page=Matlab%2F%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=show-download-screen"><span>PDF로 다운로드</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&printable=yes" title="이 문서의 인쇄용 판 [p]" accesskey="p"><span>인쇄용 판</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet" > <div class="vector-menu-heading"> 다른 프로젝트 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="페이지 도구"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="보이기"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">보이기</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">사이드바로 이동</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">숨기기</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">위키배움터</div> </div> <div id="contentSub"><div id="mw-content-subtitle"><div class="subpages">< <bdi dir="ltr"><a href="/wiki/Matlab" title="Matlab">Matlab</a></bdi></div></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="ko" dir="ltr"><table id="userboxes" style="float: right; margin-left: 1em; margin-bottom: 0.5em; background:white; width: 250px; border: #99B3FF solid 0px; clear: right"> <tbody><tr> <th style="background-color:#CCFF99; text-align:center;">자료 정보 </th></tr> <tr> <td> <div style="float:right; clear:right; margin-left:5px; margin-bottom:1px; margin-top:1px; border:1px solid #8488DC;"> <table cellspacing="0" style="width:238px; background:#F5F5FF; ; border:0px;"> <tbody><tr> <td style="width:45px;height:45px;background:#CED1FA;text-align:center;border:0px;"><span typeof="mw:File"><a href="/wiki/%ED%8C%8C%EC%9D%BC:Face-blush.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Face-blush.svg/36px-Face-blush.svg.png" decoding="async" width="36" height="36" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Face-blush.svg/54px-Face-blush.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Face-blush.svg/72px-Face-blush.svg.png 2x" data-file-width="48" data-file-height="48" /></a></span> </td> <td style="font-size:8pt; padding:0.5em; line-height:1.25em; border:0px;"><b><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%A7%84%ED%96%89%EB%8F%84" title="위키배움터:진행도">진행 상황</a></b>: 이 자료는 아직까지 만들어지는 중입니다. 여러분이 빨리 진행될 수 있도록 도와주세요. </td></tr></tbody></table> </div> <div style="clear:both"> </div></td></tr> <tr> <td><div style="float:right; clear:right; margin-left:5px; margin-bottom:1px; margin-top:1px; border:1px solid Gold;"> <table cellspacing="0" style="width:238px; background:Ivory; ; border:0px;"> <tbody><tr> <td style="width:45px;height:45px;background:#ff9;text-align:center;border:0px;"><span typeof="mw:File"><a href="/wiki/%ED%8C%8C%EC%9D%BC:Sciences_humaines.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Sciences_humaines.svg/36px-Sciences_humaines.svg.png" decoding="async" width="36" height="36" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Sciences_humaines.svg/54px-Sciences_humaines.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Sciences_humaines.svg/72px-Sciences_humaines.svg.png 2x" data-file-width="256" data-file-height="256" /></a></span> </td> <td style="font-size:8pt; padding:0.5em; line-height:1.25em; border:0px;"><b><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EA%B5%90%EC%9C%A1_%EC%88%98%EC%A4%80" title="위키배움터:교육 수준">교육 수준</a></b>: 이 자료는 <b>대학교</b> 강의 수준의 자료입니다. </td></tr></tbody></table> </div> </td></tr> <tr> <td><div style="float:right; clear:right; margin-left:5px; margin-bottom:1px; margin-top:1px; border:1px solid #71be3f;"> <table cellspacing="0" style="width:238px; background:#f6fff1; ; border:0px;"> <tbody><tr> <td style="width:45px;height:45px;background:#c0eaa6;text-align:center;border:0px;"><span typeof="mw:File"><a href="/wiki/%ED%8C%8C%EC%9D%BC:Crystal_exec.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Crystal_exec.png/36px-Crystal_exec.png" decoding="async" width="36" height="36" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Crystal_exec.png/54px-Crystal_exec.png 1.5x, //upload.wikimedia.org/wikipedia/commons/5/5b/Crystal_exec.png 2x" data-file-width="64" data-file-height="64" /></a></span> </td> <td style="font-size:8pt; padding:0.5em; line-height:1.25em; border:0px;"><b><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EA%B3%BC%EB%AA%A9" title="위키배움터:과목">과목 정보</a></b>: 이 자료는 <b>공학</b> 과목의 자료입니다. </td></tr></tbody></table> </div> <div style="clear:both"> </div></td></tr> <tr> <td><div style="float:right; clear:right; margin-left:5px; margin-bottom:1px; margin-top:1px; border:1px solid #E78A69;"> <table cellspacing="0" style="width:238px; background:Seashell; ; border:0px;"> <tbody><tr> <td style="width:45px;height:45px;background:Peachpuff;text-align:center;border:0px;"><span typeof="mw:File"><a href="/wiki/%ED%8C%8C%EC%9D%BC:Nuvola_apps_edu_miscellaneous.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Nuvola_apps_edu_miscellaneous.svg/36px-Nuvola_apps_edu_miscellaneous.svg.png" decoding="async" width="36" height="36" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Nuvola_apps_edu_miscellaneous.svg/54px-Nuvola_apps_edu_miscellaneous.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Nuvola_apps_edu_miscellaneous.svg/72px-Nuvola_apps_edu_miscellaneous.svg.png 2x" data-file-width="128" data-file-height="128" /></a></span> </td> <td style="font-size:8pt; padding:0.5em; line-height:1.25em; border:0px;"><b><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%9E%90%EB%A3%8C_%ED%98%95%EC%8B%9D" title="위키배움터:자료 형식">자료 형식</a></b>: 이 자료는 <b>강의형식</b>의 자료입니다. </td></tr></tbody></table> </div> <div style="clear:both"> </div></td></tr> <tr> <td> </td></tr> </tbody></table> <p><br /> <b>스크립트</b>란 일련의 작업들을 순서대로 진행하도록 미리 세팅해둔 것을 말합니다. 일종의 <a href="https://ko.wiktionary.org/wiki/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8" class="extiw" title="wikt:프로그램">프로그램</a>이라고 보면 됩니다. Matlab, GNU Octave에서의 스크립트는 .m 형식으로 저장되며, 언제든지 불러와서 같은 작업을 다시 실행할 수 있습니다. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="스크립트_작성과_실행"><span id=".EC.8A.A4.ED.81.AC.EB.A6.BD.ED.8A.B8_.EC.9E.91.EC.84.B1.EA.B3.BC_.EC.8B.A4.ED.96.89"></span>스크립트 작성과 실행</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=1" title="부분 편집: 스크립트 작성과 실행"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>GNU Octave에서 새 스크립트를 작성하려면 메뉴에서 File > New > New Script 를 클릭합니다. 그러면 Script 에디터가 나오고, 여기서 필요한 명령들을 차례로 입력할 수 있습니다. 예시로, 평균값을 구하는 스크립트를 작성해보겠습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">A</span><span class="p">=</span><span class="mi">1</span><span class="p">;</span> <span class="n">B</span><span class="p">=</span><span class="mi">3</span><span class="p">;</span> <span class="n">C</span><span class="p">=</span><span class="mi">5</span><span class="p">;</span> <span class="n">average</span><span class="p">=(</span><span class="n">A</span><span class="o">+</span><span class="n">B</span><span class="o">+</span><span class="n">C</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span> </pre></div> <p>이렇게 스크립트를 작성한 후, 상단의 저장 버튼을 눌러 원하는 경로에 저장해줍니다. 만든 스크립트를 실행하는 방법은 Script 에디터를 빠져나간 다음, 상단에 Current Directory에 해당 m 파일이 있는지 확인한 후, m 파일의 이름을 입력해주는 것입니다. 만약 Current Directory가 아닌 다른 경로에 m 파일이 있다면 우측의 Browse Directories를 눌러 경로를 옮겨주고 m 파일 이름을 입력해주면 됩니다. 위에서 작성한 간단한 script의 실행 결과는 다음과 같습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">average</span> <span class="n">average</span> <span class="p">=</span> <span class="mi">3</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="input">input</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=2" title="부분 편집: input"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>input을 사용하면 스크립트에서 미리 변수값을 지정해줄 필요 없이, 사용자가 원하는 값을 넣게끔 할 수 있습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">A</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value A?'</span><span class="p">)</span> <span class="n">B</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value B?'</span><span class="p">)</span> <span class="n">C</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value C?'</span><span class="p">)</span> <span class="n">average</span><span class="p">=(</span><span class="n">A</span><span class="o">+</span><span class="n">B</span><span class="o">+</span><span class="n">C</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span> </pre></div> <p>이렇게 만들고 average1.m으로 저장한 후, 실행한다면, </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">average1</span> <span class="n">value</span> <span class="n">A</span>?<span class="mi">4</span> <span class="n">A</span> <span class="p">=</span> <span class="mi">4</span> <span class="n">value</span> <span class="n">B</span>?<span class="mi">6</span> <span class="n">B</span> <span class="p">=</span> <span class="mi">6</span> <span class="n">value</span> <span class="n">C</span>?<span class="mi">9</span> <span class="n">C</span> <span class="p">=</span> <span class="mi">9</span> <span class="n">average</span> <span class="p">=</span> <span class="mf">6.3333</span> </pre></div> <p>이렇게 A, B, C값을 물어보게 하여 평균값을 구할 수 있습니다. </p> <div class="mw-heading mw-heading2"><h2 id="disp">disp</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=3" title="부분 편집: disp"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>disp를 이용해 화면에 값이나 문자를 출력할 수 있습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">A</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value A?'</span><span class="p">)</span> <span class="n">B</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value B?'</span><span class="p">)</span> <span class="n">C</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'value C?'</span><span class="p">)</span> <span class="n">average</span><span class="p">=(</span><span class="n">A</span><span class="o">+</span><span class="n">B</span><span class="o">+</span><span class="n">C</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">;</span> <span class="nb">disp</span><span class="p">(</span><span class="s">''</span><span class="p">)</span> <span class="nb">disp</span><span class="p">(</span><span class="s">'The average is : '</span><span class="p">)</span> <span class="nb">disp</span><span class="p">(</span><span class="s">''</span><span class="p">)</span> <span class="nb">disp</span><span class="p">(</span><span class="n">average</span><span class="p">)</span> </pre></div> <p>average2.m으로 저장 후 실행하면 </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">average2</span> <span class="n">value</span> <span class="n">A</span>?<span class="mi">4</span> <span class="n">A</span> <span class="p">=</span> <span class="mi">4</span> <span class="n">value</span> <span class="n">B</span>?<span class="mi">6</span> <span class="n">B</span> <span class="p">=</span> <span class="mi">6</span> <span class="n">value</span> <span class="n">C</span>?<span class="mi">7</span> <span class="n">C</span> <span class="p">=</span> <span class="mi">7</span> <span class="n">The</span> <span class="n">average</span> <span class="n">is</span> <span class="p">:</span> <span class="mf">5.6667</span> </pre></div> <p>disp('')를 입력하면 빈 줄을 출력합니다. </p><p>표처럼 나열하는 스크립트도 만들 수 있습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">yr</span><span class="p">=</span><span class="mi">1984</span><span class="p">:</span><span class="mi">2</span><span class="p">:</span><span class="mi">1996</span><span class="p">;</span> <span class="n">pop</span><span class="p">=</span><span class="mi">984</span><span class="p">:</span><span class="mi">2</span><span class="p">:</span><span class="mi">996</span><span class="p">;</span> <span class="nb">table</span><span class="p">(:,</span><span class="mi">1</span><span class="p">)=</span><span class="n">yr</span><span class="o">'</span><span class="p">;</span> <span class="nb">table</span><span class="p">(:,</span><span class="mi">2</span><span class="p">)=</span><span class="n">pop</span><span class="o">'</span><span class="p">;</span> <span class="nb">disp</span><span class="p">(</span><span class="s">'year population'</span><span class="p">)</span> <span class="nb">disp</span><span class="p">(</span><span class="s">''</span><span class="p">)</span> <span class="nb">disp</span><span class="p">(</span><span class="nb">table</span><span class="p">)</span> </pre></div> <p>pop으로 저장한 뒤 실행하면 결과는 다음과 같습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">pop</span> <span class="n">year</span> <span class="n">population</span> <span class="mi">1984</span> <span class="mi">984</span> <span class="mi">1986</span> <span class="mi">986</span> <span class="mi">1988</span> <span class="mi">988</span> <span class="mi">1990</span> <span class="mi">990</span> <span class="mi">1992</span> <span class="mi">992</span> <span class="mi">1994</span> <span class="mi">994</span> <span class="mi">1996</span> <span class="mi">996</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="fprintf">fprintf</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=4" title="부분 편집: fprintf"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>fprintf를 이용하면 텍스트와 수치값을 화면에 표시하거나 저장할 수 있습니다. 출력 형식도 따로 지정 가능합니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">fprintf</span><span class="p">(</span><span class="s">'Hello World \n\n'</span><span class="p">)</span> <span class="c">% 작은 따옴표 안에 \n을 입력하면 줄바꿈합니다.</span> <span class="nb">fprintf</span><span class="p">(</span><span class="s">'Hi'</span><span class="p">)</span> </pre></div> <p>pop2.m으로 저장한 뒤 실행하면 결과는 다음과 같이 나옵니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">pop2</span> <span class="n">Hello</span> <span class="n">World</span> <span class="n">Hi</span><span class="o">>></span> </pre></div> <p>문자열과 함께 숫자를 나타내려면 다음과 같이 합니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">pop</span><span class="p">=</span><span class="mi">90000</span><span class="p">;</span> <span class="nb">fprintf</span><span class="p">(</span><span class="s">'The population is %i. \n'</span><span class="p">,</span> <span class="n">pop</span><span class="p">)</span> </pre></div> <p>이것을 pop3.m이라 하고 실행하면, </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">pop3</span> <span class="n">The</span> <span class="n">population</span> <span class="n">is</span> <span class="mf">90000.</span> <span class="o">>></span> </pre></div> <p>즉, 작은 따옴표 안에 % 적힌 부분에 숫자가 들어갑니다. 여기서 나오는 숫자는 반드시 fprintf의 괄호 안 끝에 쉼표(,)를 찍어서 순서대로 나열해주어야 합니다. %다음에 오는 알파벳이나 숫자는 출력 형식을 지정합니다. 예시에서 사용된 %i는 정수 형태로 표시하라는 것입니다. </p><p>출력 데이터 형식은 다음과 같이 지정할 수 있습니다. </p> <ul><li>%e : 소문자 e를 이용한 지수 표시법</li> <li>%E : 대문자 E를 이용한 지수 표시법</li> <li>%f : 고정 소수점 표시법</li> <li>%g : e 표기법과 f 표기법 중 더 짧은 쪽으로 표시</li> <li>%G : E 표기법과 f 표기법 중 더 짧은 쪽으로 표시</li> <li>%i : 정수로 표시</li></ul> <p>소수점의 수도 지정해줄 수 있습니다. 예를 들어, %7.3f 라고 한다면 소수점을 포함한 일곱 자리의 수로 나타내는데, 소수점 이하 자리수는 세 자리로 나타내는 것을 의미합니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">pop</span><span class="p">=</span><span class="mf">905.3664949</span><span class="p">;</span> <span class="nb">fprintf</span><span class="p">(</span><span class="s">'The population is %7.3f. \n'</span><span class="p">,</span> <span class="n">pop</span><span class="p">)</span> </pre></div> <p>pop4.m으로 저장한 뒤 실행하면, </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">pop4</span> <span class="n">The</span> <span class="n">population</span> <span class="n">is</span> <span class="mf">905.366</span><span class="p">.</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="fprintf를_이용해_출력_값_저장하기"><span id="fprintf.EB.A5.BC_.EC.9D.B4.EC.9A.A9.ED.95.B4_.EC.B6.9C.EB.A0.A5_.EA.B0.92_.EC.A0.80.EC.9E.A5.ED.95.98.EA.B8.B0"></span>fprintf를 이용해 출력 값 저장하기</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=5" title="부분 편집: fprintf를 이용해 출력 값 저장하기"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>fprintf, fopen, fclose를 이용해 출력값을 텍스트 파일로 저장할 수 있습니다. 우선 fid라는 변수에 fopen('파일명', '권한 지정') 함수를 이용해 fid에 연 파일을 넣어줍니다. 그 다음, fid에 fprintf를 이용해 값을 적어준 후, fclose(fid)를 통해 파일을 닫아주면 됩니다. </p><p>이때 '권한 지정' 변수는 세 가지가 있는데, 기본값은 'r'입니다. </p> <ul><li>'r' : 읽기 위해 파일을 연다.</li> <li>'w' : 쓰기 위해 파일을 연다. 파일이 이미 존재하면, 파일 내용이 삭제된다. 파일이 존재하지 않으면 새 파일을 생성한다.</li> <li>'a' : 파일이 존재하는 경우 출력 값이 파일 끝에 이어서 출력된다. 나머지는 'w'와 같다.</li></ul> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">n1</span><span class="p">=</span><span class="mi">1</span><span class="p">;</span> <span class="n">n2</span><span class="p">=</span><span class="mi">2</span><span class="p">;</span> <span class="n">n3</span><span class="p">=</span><span class="mi">3</span><span class="p">;</span> <span class="n">fid</span><span class="p">=</span><span class="nb">fopen</span><span class="p">(</span><span class="s">'testfile.txt'</span><span class="p">,</span> <span class="s">'w'</span><span class="p">)</span> <span class="nb">fprintf</span><span class="p">(</span><span class="n">fid</span><span class="p">,</span> <span class="s">'This is the %i st message \n'</span><span class="p">,</span> <span class="n">n1</span><span class="p">);</span> <span class="nb">fprintf</span><span class="p">(</span><span class="n">fid</span><span class="p">,</span> <span class="s">'This is the %i nd message \n'</span><span class="p">,</span> <span class="n">n2</span><span class="p">);</span> <span class="nb">fprintf</span><span class="p">(</span><span class="n">fid</span><span class="p">,</span> <span class="s">'This is the %i rd message \n'</span><span class="p">,</span> <span class="n">n3</span><span class="p">);</span> <span class="nb">fclose</span><span class="p">(</span><span class="n">fid</span><span class="p">);</span> </pre></div> <p>이와같이 test.m 스크립트를 만들고 실행하면, 같은 경로에 testfile.txt가 생기며, 내용은 다음과 같이 나옵니다. </p> <pre>This is the 1 st message This is the 2 nd message This is the 3 rd message </pre> <div class="mw-heading mw-heading2"><h2 id="관계_연산자"><span id=".EA.B4.80.EA.B3.84_.EC.97.B0.EC.82.B0.EC.9E.90"></span>관계 연산자</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=6" title="부분 편집: 관계 연산자"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Matlab에서 조건문을 사용할 때 자주 쓰이는 것이 관계 연산자입니다. 관계 연산자를 통해 조건의 참, 거짓을 구분합니다. 참은 1, 거짓은 0입니다. </p> <ul><li>< : 우변보다 작은가</li> <li>> : 우변보다 큰가</li> <li><= : 우변보다 작거나 같은가</li> <li>>= : 우변보다 크거나 같은가</li> <li>== : 우변과 같은가</li> <li>~= : 우변과 같지 않은가</li></ul> <p>주의할 점은, 수학에서 하듯이, 3<x<5와 같이 연속으로 나열하면 안 된다는 것입니다. 이렇게 하기 위해선 논리 연산자를 같이 사용해야 합니다. </p> <div class="mw-heading mw-heading2"><h2 id="논리_연산자"><span id=".EB.85.BC.EB.A6.AC_.EC.97.B0.EC.82.B0.EC.9E.90"></span>논리 연산자</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=7" title="부분 편집: 논리 연산자"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>논리 연산자는 세 가지가 있습니다. 이 역시 조건문을 사용할 때 자주 쓰입니다. </p> <ul><li>& : And. A&B가 있다고 할 때, A와 B가 모두 참(1)이면 1이고, 둘 중 하나라도 거짓(0)이면 0. GNU Octave에서도 동작하나, 경고 메시지가 나오지 않게 하려면 &&를 씁니다. Matlab에서도 &&를 사용할 수 있습니다.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></li> <li>| : Or. A|B가 있다고 할 때, A와 B 중 하나 이상이 참(1)이면 1이고, 둘 다 거짓(0)이면 0</li> <li>~ : Not. ~A가 있다고 할 때, A가 참(1)이면 0을, 거짓(0)이면 1</li></ul> <p>관계 연산자에서 주의점으로 든 3<x<5를 Matlab에서 나타내려면 3<x & x<5와 같이 써주어야 합니다. </p> <div class="mw-heading mw-heading2"><h2 id="조건문"><span id=".EC.A1.B0.EA.B1.B4.EB.AC.B8"></span>조건문</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=8" title="부분 편집: 조건문"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Matlab에서의 조건문은 if, elseif, else의 세 가지 유형이 있습니다. 조건문의 마지막에는 end를 붙여주어야 합니다. if는 가장 처음에 오고, elseif는 if의 조건에 맞지 않는 경우 다시 새로운 조건으로 검토하게 합니다. else는 if나 elseif에서 걸러지지 않은 경우들을 일괄적으로 처리합니다. </p> <div class="mw-heading mw-heading2"><h2 id="반복문"><span id=".EB.B0.98.EB.B3.B5.EB.AC.B8"></span>반복문</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=9" title="부분 편집: 반복문"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Matlab에서의 반복문은 for-end와, while-end가 있습니다. </p> <div class="mw-heading mw-heading3"><h3 id="for-end">for-end</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=10" title="부분 편집: for-end"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>for를 사용하면 인덱스로 사용하는 변수가 증가하는 동안, 여러번 반복 계산을 할 수 있습니다. for문에서도 마찬가지로 마지막에 end를 붙여줍니다. 예를 들면 다음과 같습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="k">for</span> <span class="n">k</span><span class="p">=</span> <span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">:</span><span class="n">c</span> <span class="c">% k라는 인덱스 변수가 a부터 시작해서 b씩 증가하면서 c가 될 때까지 반복 계산</span> <span class="p">...</span> <span class="k">end</span> </pre></div> <dl><dt>예제 1</dt></dl> <p>for 문을 이용해서 <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1^{2}+4^{2}+7^{2}+10^{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mn>1</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo>+</mo> <msup> <mn>4</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo>+</mo> <msup> <mn>7</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo>+</mo> <msup> <mn>10</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle 1^{2}+4^{2}+7^{2}+10^{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e989c668112c83aa155415db905fef3c1d7ce17c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:18.55ex; height:2.843ex;" alt="{\displaystyle 1^{2}+4^{2}+7^{2}+10^{2}}"></span>를 계산하시오. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">S</span><span class="p">=</span><span class="mi">0</span><span class="p">;</span> <span class="k">for</span> <span class="n">k</span><span class="p">=</span><span class="mi">1</span><span class="p">:</span><span class="mi">3</span><span class="p">:</span><span class="mi">10</span> <span class="n">S</span><span class="p">=</span><span class="n">S</span><span class="o">+</span><span class="n">k</span>^<span class="mi">2</span><span class="p">;</span> <span class="k">end</span> <span class="n">S</span> </pre></div> <p>for_ex1.m으로 저장했을 때 출력은 다음과 같습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">for_ex1</span> <span class="n">S</span> <span class="p">=</span> <span class="mi">166</span> </pre></div> <dl><dt>예제 2</dt></dl> <p>for 문을 이용해서 <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{k=1}^{n}{\frac {k}{2^{k}}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <munderover> <mo>∑<!-- ∑ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi>k</mi> <msup> <mn>2</mn> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> </mfrac> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \sum _{k=1}^{n}{\frac {k}{2^{k}}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fee6a39c7053b8ed9d42fcf6a5e55cb7a0fd90f6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:6.829ex; height:6.843ex;" alt="{\displaystyle \sum _{k=1}^{n}{\frac {k}{2^{k}}}}"></span>를 구하는 스크립트를 작성하고, n=5에 대해 실행해 보아라. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">S</span><span class="p">=</span><span class="mi">0</span><span class="p">;</span> <span class="n">n</span><span class="p">=</span><span class="nb">input</span><span class="p">(</span><span class="s">'n?'</span><span class="p">);</span> <span class="k">for</span> <span class="n">k</span><span class="p">=</span><span class="mi">1</span><span class="p">:</span><span class="n">n</span> <span class="n">S</span><span class="p">=</span><span class="n">S</span><span class="o">+</span><span class="n">k</span><span class="o">/</span><span class="mi">2</span>^<span class="n">k</span><span class="p">;</span> <span class="k">end</span> <span class="n">S</span> </pre></div> <p>for_ex2.m으로 저장했을 때 출력은 다음과 같습니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">for_ex2</span> <span class="n">n</span>?<span class="mi">5</span> <span class="n">S</span> <span class="p">=</span> <span class="mf">1.7812</span> </pre></div> <dl><dt>예제 3</dt></dl> <p>벡터 V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, 2, 16]일 때, 양수이면서 3이나 5로 나누어 떨어지는 원소는 0으로 바꾸고, 음수이면서 -5보다 큰 원소는 1을 더해주는 스크립트를 만들어라. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">V</span> <span class="p">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">16</span><span class="p">]</span> <span class="n">n</span><span class="p">=</span><span class="nb">length</span><span class="p">(</span><span class="n">V</span><span class="p">);</span> <span class="k">for</span> <span class="n">k</span><span class="p">=</span><span class="mi">1</span><span class="p">:</span><span class="n">n</span> <span class="k">if</span> <span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o">></span><span class="mi">0</span> <span class="o">&&</span> <span class="p">(</span><span class="nb">rem</span><span class="p">(</span><span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">),</span><span class="mi">3</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span> <span class="o">|</span> <span class="nb">rem</span><span class="p">(</span><span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">),</span> <span class="mi">5</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">)</span> <span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)=</span><span class="mi">0</span><span class="p">;</span> <span class="k">elseif</span> <span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o"><</span><span class="mi">0</span> <span class="o">&&</span> <span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o">>-</span><span class="mi">5</span> <span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)=</span><span class="n">V</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="k">end</span> <span class="k">end</span> <span class="n">V</span> </pre></div> <p>for_ex3.m으로 저장 후 실행하면, </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">for_ex3</span> <span class="n">V</span> <span class="p">=</span> <span class="mi">5</span> <span class="mi">17</span> <span class="o">-</span><span class="mi">3</span> <span class="mi">8</span> <span class="mi">0</span> <span class="o">-</span><span class="mi">7</span> <span class="mi">12</span> <span class="mi">15</span> <span class="mi">20</span> <span class="o">-</span><span class="mi">6</span> <span class="mi">6</span> <span class="mi">4</span> <span class="mi">2</span> <span class="mi">16</span> <span class="n">V</span> <span class="p">=</span> <span class="mi">0</span> <span class="mi">17</span> <span class="o">-</span><span class="mi">2</span> <span class="mi">8</span> <span class="mi">0</span> <span class="o">-</span><span class="mi">7</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="o">-</span><span class="mi">6</span> <span class="mi">0</span> <span class="mi">4</span> <span class="mi">2</span> <span class="mi">16</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="while-end">while-end</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=11" title="부분 편집: while-end"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>while-end문은 조건식이 틀리지 않는 한, 명령을 반복하는 반복문입니다. for-end와 마찬가지로 마지막에 end를 넣어주어야 합니다. </p> <dl><dt>예제 1</dt></dl> <p>x=1부터 시작할 때, x가 10보다 작다면 계속 x를 세 배씩 증가시키는 스크립트를 작성하여라. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="n">x</span><span class="p">=</span><span class="mi">1</span><span class="p">;</span> <span class="k">while</span> <span class="n">x</span><span class="o"><</span><span class="p">=</span><span class="mi">10</span> <span class="n">x</span><span class="p">=</span><span class="mi">3</span><span class="o">*</span><span class="n">x</span> <span class="k">end</span> </pre></div> <p>while_ex1.m으로 저장 후 실행하면 </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">while_ex1</span> <span class="n">x</span> <span class="p">=</span> <span class="mi">3</span> <span class="n">x</span> <span class="p">=</span> <span class="mi">9</span> <span class="n">x</span> <span class="p">=</span> <span class="mi">27</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="사용자_정의_함수"><span id=".EC.82.AC.EC.9A.A9.EC.9E.90_.EC.A0.95.EC.9D.98_.ED.95.A8.EC.88.98"></span>사용자 정의 함수</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=12" title="부분 편집: 사용자 정의 함수"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>사용자 정의 함수란, Matlab 내에서 내장함수처럼 사용할 수 있는, 사용자가 만든 임의의 함수를 말합니다. 형식은 다음과 같습니다. </p> <pre>function [output_arguments] = function_name(input_arguments) </pre> <p>[output_arguments]에는 출력 인자들을, function_name은 만들 사용자 함수의 이름을 적어주면 되고, input_arguments에는 입력해주어야 하는 인자들을 넣어줍니다. 주의점은 m파일을 저장할 때 파일명을 function_name으로 해주어야 한다는 것입니다. </p> <dl><dt>예제</dt></dl> <p><a href="https://ko.wikipedia.org/wiki/%ED%99%94%EC%94%A8" class="extiw" title="w:화씨">화씨</a> 온도를 섭씨 온도로 바꾸어주는 사용자 정의 함수를 만들어봅니다. 스크립트 편집기를 띄우고 다음과 같이 입력한 뒤, FtoC.m으로 저장해봅니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="k">function</span><span class="w"> </span>C<span class="p">=</span><span class="nf">FtoC</span><span class="p">(</span>F<span class="p">)</span> <span class="n">C</span><span class="p">=</span><span class="mi">5</span><span class="o">*</span><span class="p">(</span><span class="n">F</span><span class="o">-</span><span class="mi">32</span><span class="p">)</span><span class="o">/</span><span class="mi">9</span><span class="p">;</span> </pre></div> <p>다시 Command Window로 돌아가서 변환하고 싶은 화씨온도를 함수에 입력해봅니다. </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">FtoC</span><span class="p">(</span><span class="mi">200</span><span class="p">)</span> <span class="n">ans</span> <span class="p">=</span> <span class="mf">93.333</span> <span class="o">>></span> <span class="n">FtoC</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span> <span class="n">ans</span> <span class="p">=</span> <span class="mf">37.778</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="feval">feval</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=13" title="부분 편집: feval"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>스크립트 내에서 feval(f, a)를 사용하면, 함수 f에 a값을 대입한 결과를 구할 수 있습니다. 주로 다음에 설명하는 익명함수와 함께 쓰입니다. </p> <div class="mw-heading mw-heading2"><h2 id="익명함수"><span id=".EC.9D.B5.EB.AA.85.ED.95.A8.EC.88.98"></span>익명함수</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=14" title="부분 편집: 익명함수"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>익명함수는 function이 들어가는 별도의 m파일을 만들지 않고, Command window에서 임시로 사용할 함수를 지정하는 것입니다. 형식은 다음과 같습니다. </p> <pre>name = @(입력 인자) 수학식 </pre> <p>예를 들어 <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(x)=x^{3}-x^{2}+1}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>=</mo> <msup> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msup> <mo>−<!-- − --></mo> <msup> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo>+</mo> <mn>1</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(x)=x^{3}-x^{2}+1}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/087d5ee86e0674317dd2e6e55a79a5165cfbfd6a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:19.127ex; height:3.176ex;" alt="{\displaystyle f(x)=x^{3}-x^{2}+1}"></span>라는 함수를 익명함수로 만든다면 </p> <pre>f = @(x) x.^3 - x.^2 + 1 </pre> <p>이라고 한 뒤에, 예를 들어 f(1)을 계산하고자 한다면 </p> <div class="mw-highlight mw-highlight-lang-octave mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span> <span class="n">f</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="n">ans</span> <span class="p">=</span> <span class="o">-</span><span class="mi">1</span> </pre></div> <p>이렇게 해주면 됩니다. </p> <div class="mw-heading mw-heading2"><h2 id="각주"><span id=".EA.B0.81.EC.A3.BC"></span>각주</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=15" title="부분 편집: 각주"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://kr.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html">https://kr.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html</a></span> </li> </ol> <div class="mw-heading mw-heading2"><h2 id="참고_자료"><span id=".EC.B0.B8.EA.B3.A0_.EC.9E.90.EB.A3.8C"></span>참고 자료</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&action=edit&section=16" title="부분 편집: 참고 자료"><span>편집</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>충북대 수치해석 강의</li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐7d9797f5d‐c46qk Cached time: 20241120002207 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.122 seconds Real time usage: 3.075 seconds Preprocessor visited node count: 616/1000000 Post‐expand include size: 11270/2097152 bytes Template argument size: 1050/2097152 bytes Highest expansion depth: 12/100 Expensive parser function count: 27/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 21036/5000000 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 35.337 1 -total 100.00% 35.337 1 틀:상태상자 49.28% 17.415 1 틀:진행중 41.56% 14.686 1 틀:진행상자 36.07% 12.746 3 틀:문서상자 21.95% 7.757 1 틀:대학_강의 15.47% 5.468 1 틀:Edlevelbox 9.63% 3.404 4 틀:Robelbox/C2 9.24% 3.264 1 틀:강의형 9.23% 3.260 4 틀:Robelbox/C1 --> <!-- Saved in parser cache with key kowikiversity:pcache:3425:|#|:idhash:canonical and timestamp 20241120002207 and revision id 32996. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">원본 주소 "<a dir="ltr" href="https://ko.wikiversity.org/w/index.php?title=Matlab/스크립트&oldid=32996">https://ko.wikiversity.org/w/index.php?title=Matlab/스크립트&oldid=32996</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/%ED%8A%B9%EC%88%98:%EB%B6%84%EB%A5%98" title="특수:분류">분류</a>: <ul><li><a href="/w/index.php?title=%EB%B6%84%EB%A5%98:%EA%B5%AC%EC%8B%9D_source_%ED%83%9C%EA%B7%B8%EB%A5%BC_%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94_%EB%AC%B8%EC%84%9C&action=edit&redlink=1" class="new" title="분류:구식 source 태그를 사용하는 문서 (없는 문서)">구식 source 태그를 사용하는 문서</a></li><li><a href="/wiki/%EB%B6%84%EB%A5%98:%EC%A7%84%ED%96%89_%EC%A4%91%EC%9D%B8_%EC%9E%90%EB%A3%8C" title="분류:진행 중인 자료">진행 중인 자료</a></li><li><a href="/wiki/%EB%B6%84%EB%A5%98:%EB%8C%80%ED%95%99_%EC%88%98%EC%A4%80" title="분류:대학 수준">대학 수준</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> 이 문서는 2020년 9월 16일 (수) 10:37에 마지막으로 편집되었습니다.</li> <li id="footer-info-copyright">내용은 <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.ko">크리에이티브 커먼즈 저작자표시-동일조건변경허락 라이선스</a>에 따라 사용할 수 있으며 추가적인 조건이 적용될 수 있습니다. 자세한 내용은 <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use/ko">이용 약관</a>을 참조하십시오.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">개인정보처리방침</a></li> <li id="footer-places-about"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EC%86%8C%EA%B0%9C">위키배움터 소개</a></li> <li id="footer-places-disclaimers"><a href="/wiki/%EC%9C%84%ED%82%A4%EB%B0%B0%EC%9B%80%ED%84%B0:%EB%A9%B4%EC%B1%85_%EC%A1%B0%ED%95%AD">면책 조항</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">행동 강령</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">개발자</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/ko.wikiversity.org">통계</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">쿠키 정책</a></li> <li id="footer-places-mobileview"><a href="//ko.m.wikiversity.org/w/index.php?title=Matlab/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">모바일 보기</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-669b4ddb54-j5xrd","wgBackendResponseTime":123,"wgPageParseReport":{"limitreport":{"cputime":"0.122","walltime":"3.075","ppvisitednodes":{"value":616,"limit":1000000},"postexpandincludesize":{"value":11270,"limit":2097152},"templateargumentsize":{"value":1050,"limit":2097152},"expansiondepth":{"value":12,"limit":100},"expensivefunctioncount":{"value":27,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":21036,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 35.337 1 -total","100.00% 35.337 1 틀:상태상자"," 49.28% 17.415 1 틀:진행중"," 41.56% 14.686 1 틀:진행상자"," 36.07% 12.746 3 틀:문서상자"," 21.95% 7.757 1 틀:대학_강의"," 15.47% 5.468 1 틀:Edlevelbox"," 9.63% 3.404 4 틀:Robelbox/C2"," 9.24% 3.264 1 틀:강의형"," 9.23% 3.260 4 틀:Robelbox/C1"]},"cachereport":{"origin":"mw-web.codfw.main-7d9797f5d-c46qk","timestamp":"20241120002207","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>