I'm calling a python script from matlab. The python script needs 3 arrays as input arguments:
import sys
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.set_aspect('equal')
X = np.array(float(sys.argv[1]), dtype =np. float32)
Y = np.array(float(sys.argv[2]), dtype =np. float32)
Z = np.array(float(sys.argv[3]), dtype =np. float32)
scat = ax.scatter(X, Y, Z)
I call the Python script from Matlab like this:
!"MYPATH\python.exe" test3.py dX dY dZ
In Matlab, dX, dY and dZ are all 1x500 array type.
However, I get the following error:
ValueError: could not convert string to float: dX
It looks like the python script call doesn't evaluate the dX array and takes the argument as a string. How can I correct that?