Matlab function block Does not support 'fopen' code generation?
Mostra commenti meno recenti
I wrote a simple write binary file function with 'fopen' function for C code generation, but it is not supported in MATLAB function block, how can I solve it in simulink withn matlab function block ?(matlab coder generates it with no problem)
Also how to ensure the correct generation of string scalar or character vector variable length input? Thanks in advance
My model is attached.
function flag = fcn(binName)%#codegen
% coder.varsize('binName',[1,255]);
fid = fopen(binName,'w');
fprintf(fid,'%s','test');
fclose(fid);
flag = 1;

test in MATLAB 2021a
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Event Functions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!