Skip to content

Instantly share code, notes, and snippets.

@THiyama
Last active September 19, 2018 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save THiyama/0cec3d558aa3220e1718cc2dc3e1e1d5 to your computer and use it in GitHub Desktop.
Save THiyama/0cec3d558aa3220e1718cc2dc3e1e1d5 to your computer and use it in GitHub Desktop.
MATLABからPythonコードを実行したい。
cd C:\Anaconda3
command = "python C:\test.py 2 3"
status = dos(command)
%%%%実行結果%%%%
% command =
% "python C:test.py 2 3"
% 和:5
% status =
% 0
%%%%実行結果%%%%
import sys
args = sys.argv
a = args[1]
b = args[2]
c = int(a) + int(b)
print("和:" + str(c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment