MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   matlab coder requirements stricter than normal matlab (https://www.labfans.com/bbs/showthread.php?t=22181)

poster 2019-11-27 10:02

matlab coder requirements stricter than normal matlab
 
<p>Consider the following matlab program:</p>

<pre><code>function results = prog()
opts.x = 1;
if ~isfield(opts, 'y'); opts.y = 1; end
'asdf'
return
</code></pre>

<p>I am able to run this program successfully in matlab however when I try to use coder to convert it to C I get the following error:</p>

<pre><code>This structure does not have a field 'y'; new fields cannot be added when structure has been read or used.
</code></pre>

<p>I would like to know if there is a way to convert to C using coder (or possible some other tool) that does not use a stricter compiler as seems to be the case with coder as I am using it. I am using matlab version R2019B.</p>

<p>Please note that this is just one of many examples of how coder is using a stricter compiler than normal matlab. I have a fairly large program that I would like to convert to C and I don't want to have to go through each error (there are over 100).</p>



[url=https://stackoverflow.com/questions/58786128/matlab-coder-requirements-stricter-than-normal-matlab]More answer...[/url]


所有时间均为北京时间。现在的时间是 21:15

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.