Saeid AsgarnezhadZorgabad
Subscriber

Sorry but I don't understand what you are saying Kyle.

Let me show you my code. First I have made a matrix:

M_data=np.array([f,eps])

Then I set the name as:

Mat_Name='Quantum dot'

Then I have added these lines:

temp=fdtd.addmaterial('Sampled data')      

fdtd.setmaterial(temp,'name',Mat_Name)
fdtd.setmaterial(Mat_Name,'max coefficients',2)
fdtd.setmaterial(Mat_Name,'sampled data',M_data)

and I get this error: "the number of columns for the data in 'sampled 3d data' should be either 2 or 4"

Indeed the shape of M_data is (2,3000) and has 2 columns. So I am not sure what the error is. Can you be more specific and kindly correct my code instead of "explaining"?