how can i open message key catalog?

how can i open the message catalog in matlab? i am using the sptool.m file in toolbox/signal. in getstring(message('signal:sptprefhelp:Maker')) if i change 'Marker' to 'Markers' it warning:unable to find message key 'Markers' in catalog 'signal:sptprefhelp'. ...so where can i check or find the message keys?

 採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 19 日

1 投票

When you see
message('signal:sptprefhelp:Maker')
then examine the file
fullfile(matlabroot, 'resources', 'signal', 'en', 'sptprefhelp.xml')
It will have a number of entries, such as
<entry key="ByClickingOnACategoryThePanelOnTheRightChangesToReflect">By clicking on a category, the panel on the right changes to reflect the preferences for that category.</entry>
Look for the one for which key=" matches the last component of the message identifier, Maker in the case of your example. So you would be looking for
<entry key="Maker">SOME TEXT HERE</entry>
In R2017b, neither "Maker" or "Marker" appear in that file, but "Markers" does:
<entry key="Markers">Markers</entry>
The 'en' part can instead be 'ja_JP', 'ko_KR' or (sometimes) 'zh_CN' for the messages localized to Japanese, Korean, or Chinese.

1 件のコメント

Landers1
Landers1 2017 年 12 月 19 日
I got it. Thank you very much!

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

その他の回答 (1 件)

Steven Lord
Steven Lord 2017 年 12 月 18 日

0 投票

You shouldn't need to access or update the message catalog files.
What exactly did you expect / hope would happen by changing Marker to Markers in that call?

3 件のコメント

Landers1
Landers1 2017 年 12 月 19 日
i am writing my script, and i notice that the 'signal' toolbox has update its code by using 'message',i hope to use 'message' function and know how it works, how can i update my message catalog file. thanks.
Steven Lord
Steven Lord 2017 年 12 月 19 日
You shouldn't need to. If you want to throw an error using an identifier (to allow users of your code to catch a particular error your code throws, for example) call error with two (or more) inputs as shown in the "Throw Error with Formatted Message" example in the documentation.
Landers1
Landers1 2017 年 12 月 19 日
Thanks for your suggestion. i will learn to use that.

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

カテゴリ

ヘルプ センター および File ExchangeMATLAB 快速入门 についてさらに検索

製品

タグ

質問済み:

2017 年 12 月 18 日

コメント済み:

2017 年 12 月 19 日

Community Treasure Hunt

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

Start Hunting!