Why does MATLAB Coder generate C-code that produces NaN values where MATLAB source does not?

7 views (last 30 days)
My C-main calls the correct interface, gets a return array where a large contiguous subset of the values are NaN. The MATLAB source concatenates 3 arrays to give the result, and it's the third of the concatenated arrays that gives all NaNs. The original MATLAB source executes fine and gives good results. The problem appears to arise in the generated code.
For running Coder, debug is on; checked for memory errors with Valgrind; can't trace the problem.
  1 Comment
José-Luis
José-Luis on 22 Aug 2014
It is very hard, and inefficient, to try and help you without looking at the offending code. Please post a minimum working example of your problem. As an added bonus, you usually find the solution to the problem yourself when you do that.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!