Matlab with printing error

2 ビュー (過去 30 日間)
Adrian Cristian
Adrian Cristian 2022 年 4 月 12 日
編集済み: KSSV 2022 年 4 月 12 日
Hello! So I have a script. Until now it worked good, but I changed some internal things and now a print won't work. It is not called in the code too often, yet I don't know what it has. The script starts with:
fid = fopen('Output_Results.txt', 'wt');
and the error is on the first line:
fprintf(fid, 'Frame path: %s\n', frame_path);
fprintf(fid, 'Core path: %s\n', core_path);
fprintf('Frame path: %s\n', frame_path);
fprintf('Core path: %s\n', core_path);
idxCore = idxCore + 1;
error is:
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in compare_bun (line 135)
fprintf(fid, 'Frame path: %s\n', frame_path);
I use Matlab R2020b, TargetLink 5.1p1
  1 件のコメント
KSSV
KSSV 2022 年 4 月 12 日
編集済み: KSSV 2022 年 4 月 12 日
Check the value of fid..... the error is clear, the required file is not opened. Did you change the path after openeing the file to write?
Also what are the values of frame_path. etc..? Show us the complete code.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by