Is there a way of getting the "LoggingName" and "Source Port" of all the Logging Selected Signals directly in Matlab?
5 ビュー (過去 30 日間)
古いコメントを表示
Hello all,
I have a Simulink model in which there are some Logging Selected Signals. I can manually check the "LoggingName" of all the Logging Selected Signals by opening the Simulink model and then going under Configuration Parameters > Data Import/Export > Signal logging > Configure Signals to Log... (see the image below).
Is there a way of getting the "LoggingName" and "Source Port" of all the Logging Selected Signals directly in Matlab without opening the Simulink Signal Logging Selector?
If I open the Simulink model and manually Log Selected Signal, the name of the signal is stored under "Source Port" but not under "LoggingName". Is there a way of storing the signal name under "LoggingName"?
It would be a great help to me if someone could give me a solution.
Thank you in advance.
0 件のコメント
回答 (1 件)
Fangjun Jiang
2021 年 4 月 28 日
After a simulation, your signal logging data is saved as, e.g. logsout
Run logsout.getElementNames and other API to get the info you need
You need to right click the signal line, select properties, and provide a signal name
2 件のコメント
Fangjun Jiang
2021 年 4 月 29 日
Then do something like this. Use set() to change name in a for-loop after checking names
hLine=find_system('YourModel','FindAll','On','type','line');
index=cell2mat(get(hLine,'DataLogging'))
get(hLine(index),'name')
参考
カテゴリ
Help Center および File Exchange で Prepare Model Inputs and Outputs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!