If you have Embedded Coder, the configuration settings IndentSize and IndentStyle allow you to tweak the behavior you've requested:
https://www.mathworks.com/help/coder/ref/coder.embeddedcodeconfig.html?s_tid=doc_ta
More generally, if you're looking for further customization of the generated code's formatting, you could consider running an external code formatting tool on it like clang-format.
The answer:
https://www.mathworks.com/matlabcentral/answers/391533-is-there-a-way-to-disable-line-wrapping-in-generated-c-code-from-matlab-coder
shows how you could automate that. I'll reproduce the steps here for completeness.
The Coder config setting PostCodeGenCommand allows you to run some MATLAB code after code generation finishes but before the C/C++ compiler runs. So you can use that to call clang-format.
Make the file doclangformat.m:
function doclangformat(buildInfo)
sourceFiles = join(buildInfo.getSourceFiles(true,true));
sourceFiles = sourceFiles{1};
cmd = ['clang-format -i -style=''{BasedOnStyle: LLVM, ColumnLimit: 20}'' ' sourceFiles];
system(cmd);
I've set ColumnLimit to 20 so the effect is obvious. The code will be drastically wrapped. You can view the other options in the clang-format documentation.
Set up the configuration object and call codegen:
cfg = coder.config('lib');
cfg.PostCodeGenCommand = 'doclangformat(buildInfo)';
codegen foo -config cfg <other codegen args>
Now you should see that your code is wrapped to about 20 columns.
The main downside of this approach is that the other Coder style settings like IndentStyle, IndentSize, etc. will need to be specified in your clang-format specification.