Re: Break Line



In article <0231e91f-4157-46c1-bdad-07d3aa9057d4@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
shapper <mdmoura@xxxxxxxxx> wrote:

When I am writing a line code in Matlab Editor and I need to break the
line do I need to add the 3 dots?

For example:

history = struct('title', {my title}, ...
'description', {my description});

Yes.

The one place that I have found that you do *not* need the three
dots is in creating a matrix, such as

foo = [ 1 2 3
4 5 6
7 8 9 ];

When this syntax is used, the line break is treated as a ';', as if
you had written,

foo = [ 1 2 3; ...
4 5 6; ...
7 8 9 ];

If you accidently forget a ... in the middle of a vector you are
creating, and by chance you happen to have the same number of elements
before and after the break, you will end up with a 2 x N array
instead of the 1 x (N*2) array you expected. This can produce
sudden surprises later! (If the number of elements does not match
then you get lucky and it will complain as soon as it attempts to
execute the statement.)
--
"Okay, buzzwords only. Two syllables, tops." -- Laurie Anderson
.



Relevant Pages

  • Re: scan dpi for photos
    ... A digital photograph is essentially an array, ... Each element in the array is called a pixel, ... inkjet, DM, or laser printers all the dots are the same size. ... does for the complex "dithering" you speak. ...
    (rec.photo.digital)
  • Re: Collections of structured-data objects: what approach?
    ... connecting the dots might help others stumbling along this way, and you never know it might turn out that your "consistency" comment was referring to something else I didn't see. ... the reason is probably that Array and Hash are so powerful on the one hand and that requirements are so different on the other hand. ...
    (comp.lang.ruby)
  • Re: Imaginary Polynomial Time Algorithm for Subset sum Problem
    ... While on any realistic computer/model, copying an array, would take time proportional to its size. ... copying an array does not take up time which is proportional to the size of the array on a parallel computer. ... This is not the case of the OP's stamping process which copy as many dots as wanted in time 1 without explicitely creating all these processors. ...
    (comp.theory)
  • Re: Padding fixed-length strings
    ... Richard Maher wrote on 15 apr 2007 in comp.lang.javascript: ... I'll use the Array length/joinat initialize time as a ... (Please change the x'es to dots in my emailaddress) ...
    (comp.lang.javascript)
  • Re: OWLS Without Absolute Synchronization
    ... We obtain light curves like the dots in this. ... |>Have a nice array of rotating dots: ... I've got a free bus pass, I may take a ride into town for a change, ...
    (sci.physics.relativity)

Loading