我使用mex
命令來構建包含在sfun.c
我的C代碼:傳遞字符串參數Matlab的MEX命令
mex CFLAGS="\$CFLAGS -std=gnu99" sfun.c;
可正常工作。但是,我想以編程方式更改部分CFLAGS="\$CFLAGS -std=gnu99"
。我想這部分分配給一個變量,並把它傳遞給mex
命令緊隨其後,但它失敗:
bv = 'CFLAGS="\$CFLAGS -std=gnu99"'
mex bv sfun.c
Matlab的返回此錯誤:
gcc: error: bv: No such file or directory
mex: compile of ' "sfun.c"' failed.
什麼是用程序生成bv
最接近的方式並將該值傳遞給mex
命令?
如果您找到解決方案,我會很感激它,如果你分享它。 – Ian