Why am I unable to insert new line/tabs in code using TLC string?
Show older comments
I am writing a TLC file to inline an s-function when generating code. In the TLC file, I do a lot of string parsing to generate desirable code for the s-function. While doing so, I am unable to insert newlines and tabs in the generated code in a controlled manner.
The TLC file consists of the following code:
%assign output2_if_else_string = "Start_String : \t"
%assign output2_if_else_string = FEVAL ("strcat", output2_if_else_string, "My name is")
%assign output2_if_else_string = FEVAL ("strcat", output2_if_else_string, "\n")
%assign output2_if_else_string = FEVAL ("strcat", output2_if_else_string, "Anuj Gupta")
I expect the output in my generated c code to contain the following strings:
************************************************
Start_String:My name is
Anuj Gupta
************************************************
Instead the output appears as follows:
************************************************
Start_String :My name isAnuj Gupta
************************************************
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!