MATLAB line continuation within string

 In MATLAB, ... is used to continue a line to the next line. But if I want to continue a long string within quotation, what can I do? ... will be treated as a part of the string itself. Using [] is not a perfect solution since in most cases I use sprintf/fprintf to parse a long string like sql query. Using [] would be cumbersome. thanks. 

Note - this is related to character arrays, not strings, per se, which is a separate type in newer versions of Matlab a = 'a character array'b = "a string"   


NOTE:-


Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. 

Answers:

If you put the string in brackets, you can build it in several pieces: 

 

s = ['abc' 'def' ...  
SEE COMPLETE ANSWER CLICK THE LINK  
https://matlabhelpers.com/questions/matlab-line-continuation-within-string.php

Comments

Popular posts from this blog

Why do I get a "Too many input arguments" error when not passing any?

Why Red, Green, Blue channels of image separetely are grayscaled (Matlab)?

How is full convolution performed using MATLAB's conv2 function?