How to find the warning identifier from a warning message?

68 ビュー (過去 30 日間)
Raja Vardhan Reddy Kothakapu
Raja Vardhan Reddy Kothakapu 2020 年 4 月 14 日
Hi everyone,
I have a warning message in Simulink and I am looking to find the warning message identiier. So, that I can add to a list of identifiers in my code which need to be ignored during the build process. Could someone tell me is there any way to find the warning identifier of a particular warning message? or does Simulink have any documentations, where it provides list of all possible errors and warnings with their identifiers?
This is my warning message: ''Warning: Unable to honor user-specified priorities''
Thank you in Advance!!
  2 件のコメント
Rik
Rik 2020 年 4 月 14 日
In Matlab itself you can use [msg,msgID] = lastwarn; to retrieve the warning ID. I don't know if there is an easy way to retrieve this in Simulink. Running that function in Matlab might work.
Raja Vardhan Reddy Kothakapu
Raja Vardhan Reddy Kothakapu 2020 年 4 月 14 日
@Rik Thanks for your reply. I already tried above command. It works only when simulink generates the warning. In my case, I just have the warning message and I don't know where and when it occurs. I need to find the identifier and add this to the another file, which ignores this warning during build process.

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

採用された回答

Walter Roberson
Walter Roberson 2020 年 4 月 14 日
'Simulink:Engine:UnableToHonorPriority'
I searched the .xml message files using Unix commands.
cd(matlabroot)
!find . -depth -name \*.xml -print0 | xargs -0 egrep -i "Unable to honor user-specified priorities"
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 14 日
>> warning(message('Simulink:Engine:UnableToHonorPriority', 'A', 1, 'B', 2))
Warning: Unable to honor user-specified block priorities. 'A' with a block priority 1 has to execute before 'B' that has a higher block priority 2 to
satisfy data dependencies.
There can be any number of colons in the name. Each one except the last corresponds to a subdirectory within fullfile(matlabroot, 'resources') with the major product being followed by the language code, and with the final token appearing as a key in the xml file. For example
./resources/Simulink/en/Engine.xml:
<entry key="UnableToHonorPriority">Unable to honor user-specified priorities. ''{0}'' (pri={1}) has to execute before ''{2}'' (pri={3}) to satisfy data dependencies</entry>
or
>> warning(message('optim:algorithm:checkInitialPoint:WrongSizeX0'))
Warning: x0 must have the same number of elements as f, or as the number of columns of A or Aeq.
corresponding to resources/optim/en/algorithm/checkInitialPoint.xml key WrongSizeX0
Raja Vardhan Reddy Kothakapu
Raja Vardhan Reddy Kothakapu 2020 年 4 月 14 日
編集済み: Raja Vardhan Reddy Kothakapu 2020 年 4 月 14 日
Yes, I agree with you. I also found the xml you are referring to. Thank you very much!!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by