How to handle long code?

7 visualizaciones (últimos 30 días)
Jaksan
Jaksan el 8 de Feb. de 2012
I am creating a matrix and the code is very long as I am using diag to create diags of ones at different places in the matrix. Is there some way to keep the string complete even when going to a new line? The sting of code is stretching well out of bounds
Thanks

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Feb. de 2012
You can continue code by typing 3 dots at the end of a line and then moving on to the next line
fidnerts = this + ...
that .* the ...
./ other;
Note: you cannot break up a literal string this way.
nirfinw = 'this is ...
not legal!';

Categorías

Más información sobre Numeric Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by