개발 흉내내기/MATLAB 4

[Matlab] python 함수 실행

1. 실행하고자 하는 Python 함수를 미리 작성해 놓는다 (argument를 받는 python 코드에 대해 추후 작성) - D:\path1\example.py 라고 가정 - 다음과 같이 example.py의 위치를 지정 PyCodePath = 'D:\path1\example.py' (절대경로) PyCodePath = './example.py' (m파일이 example.py와 같은 폴더에 있는 경우 상대경로 사용 가능) 2. 실행하고자 하는 environment 이름이 abcde일 경우, python.exe의 경로 세팅 ex. PythonPath = 'C:\users\{UserName}\Anaconda3\envs\{abcde}\python.exe'; 3. example.py를 실행하는 command는 ..

[Matlab] Figure에서 data 추출하기

참조: https://kr.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from-matlab-figures 1. Figure를 활성화한다. 2. 활성화된 figure로부터 handle을 설정 h = gcf;(gcf function 참조: https://kr.mathworks.com/help/matlab/ref/gcf.html) 3. figure handle에서 축 (axes)는 'child' value로 호출(?)되고 각 축의 data는 축의 'child' value로 호출(?)됨 axesObjs = get(h, 'Children'); % axes handlesdataObjs = get(axesObjs, 'Children'); %ha..