How can I tell MATLAB that a testbench is in a subdirectory?

1 view (last 30 days)
I am using embedded coder to generate c-code from my MATLAB function. I am also using -double2single option for the codegen command. In my coder.SingleConfig object I define a testbench. The file of the testbench is in a subdirectory of my project (I added the subdirectory to my working directory with addpath(...)).
When I start code generation process it can not find the testbench. I always get the message "Could not open file <path to testbench>. No such file or directory." I also changed the name to the absolute testbench file path, but it still can not find the file. Instead it even removed the subdirectory name from the path and tried to look for the file in the root of my working directory.
How can I tell MATLAB to use the testbench file in the subdirectory?

Answers (1)

Navan Ruthramoorthy
Navan Ruthramoorthy on 25 Jul 2019
For double2single conversion, currently the test bench file needs to be present in the same directory as the design file. Please store your test bench files in the same directory as design files to work around this issue. We will consider supporting test bench in a different directory in path for a future release.


Find more on Single-Precision Conversion in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by