Optics

Optics

Topics related to Speos.

FDTD error while importing a source / “Matlab array does not contain a dire….”

    • Patrick Millar
      Subscriber

      I have been trying to import a custom source into my FDTD simulation. I started by following the steps from FDTD lesson 7. This lesson gives script to generate a .mat file of which can be simply selected from an "input source" edit menu. However as I try to I keep recieving the following error. The .mat file and the FDTD file are both in the same file and both in C: drive, locally on my computer. I have tried moving the two to other folders however I keep recieving the same error. I am confused as I have followed the steps from the video exactly and can't see where I am going wrong. I assume the directory issue is to do with the location of the files however I can't see why this might be a problem while in my C: drive.

      Any help would be great. Happy to expand further as to the location of the files etc.

      Error: 

      "Could not create a dataset from the file. The error is 'Matlab array does not contain a directory field'. Please check the documentatoin on the correct file format."

       

    • Guilin Sun
      Ansys Employee

      Please try to use this example:

      https://optics.ansys.com/hc/en-us/articles/360034383054-Using-an-equation-to-define-the-spatial-field-profile-of-a-source-in-FDTD

      I tested, and it works fine.

      Most likely the dataset has problem.

      • Patrick Millar
        Subscriber

        Hi Guilin,

         

        Thank you! Just tried this and worked fine, I can work around this. Still not sure why the other issue occured but glad I can work it this way instead.

         

        Thanks!

    • Guilin Sun
      Ansys Employee

      Hi Patrick, I am glad to know that anyway you made it working for you.

      Another possibility is, you used Matlab to create the data directly, which sometimes it does not work well. However you mentioned you used the video tutorial script. It is a little strange. 

Viewing 2 reply threads
  • The topic ‘FDTD error while importing a source / “Matlab array does not contain a dire….”’ is closed to new replies.