フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I make new .txt files by naming them like the saved Simulink models in the same folder and write the information of Diagnostic Viewer of each model into these txt files seperately?

1 回表示 (過去 30 日間)
OK
OK 2019 年 8 月 2 日
閉鎖済み: dpb 2019 年 8 月 3 日
Hello people,
i am stuck with the following code, because I can't create new txt files by naming them as same as name of my saved Simulink models in the same folder. Besides I want the code to write the whole information from Diagnostic Viewer to these txt files due to consistency between model's name and txt file's name separately.
F.e. Simulation1.txt about Simulation1.slx
Simulation2.txt about Simulation2.slx etc.
Also I hope that you can help me for it.
Thank you very much in advance!
PATH = 'C:\Users\xxx\Documents\Saved_Models';
TxtFiles = fullfile(PATH, '*.txt');
allTxtFiles = dir(TxtFiles);
for i=1:nFiles
%Codes for simulation run
%---%
handles.txtFilename = allTxtFiles(i).name;
Filename = fullfile(PATH, handles.txtFilename);
fid = fopen(Filename);
%sprintf('Simulation%d.txt', i);
sldiagviewer.diary(handles.txtFilename);
end

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by