How to display the generated code in one line?

1 回表示 (過去 30 日間)
Xiaojie Qiu
Xiaojie Qiu 2018 年 7 月 16 日
コメント済み: Xiaojie Qiu 2018 年 7 月 17 日
Hello everyone,
after code generation, the generated code will always be displayed in multiple lines, just as shown below:
simulink_function_DW.u8_ErrorCounter = (uint8_T)(((uint32_T)
simulink_function_DW.u8_ErrorCounter) + 1U);
But I don't find it good for readability. So I want to know how to configure simulink model so that the code will be displayed just in one line, just like the following style:
simulink_function_DW.u8_ErrorCounter = (uint8_T)(((uint32_T)simulink_function_DW.u8_ErrorCounter) + 1U);
Thank you!

採用された回答

Ryan Livingston
Ryan Livingston 2018 年 7 月 16 日
編集済み: Ryan Livingston 2018 年 7 月 16 日
This is a similar question to:
The short answer is that there is not currently a built-in setting to do this. You can use an external code formatting tool like clang-format to reformat the code to suit your needs. The answer to that question shows how to integrate clang-format with the code generation process to get the line wrapping you desire.
I've made an internal note of this request so we can consider adding such functionality in the future.
  1 件のコメント
Xiaojie Qiu
Xiaojie Qiu 2018 年 7 月 17 日
Thank you Ryan! I'll try it later.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by