Loren on the Art of MATLAB

Archive for the ‘Travel’ Category


Loren Shure works on design of the MATLAB language at The MathWorks. She writes here about once a week on MATLAB programming and related topics.

  • Loren: Jos- You’re right about the title! Ben- Thanks for another solution. –Loren
  • Jos: Again an interesting blog! However, the title of this blog is somewhat misleading. Shouldn’t the word...
  • Ben: I think Mike’s answer is probably the most intuitive, but I would have answered it like Jos only using...
  • Pär Lansåker: It is often better to use an obvious path for understanding. I would use a combinationd of diff(A)...
  • Joe P.: Paul R. Martin refers to “a chronic problem with cutting-and-pasting MatLab figures using Mac OS X...
  • Mike Koets: If we do want to allow answers of zero (I assumed we did not want that), then we can use this code...
  • Loren: Matt- Your solution is certainly viable as well! –Loren
  • matt fig: Here’s my crack at it. I don’t think it is too abstruce. zr = findstr(A,0); mx =...
  • Loren: Mike- I think it doesn’t give the right answer for this case. >> C = [1 2 -4 0 0]; >>...
  • Mike Koets: How about this: max(c(intersect(find (c),[find(c==0)+1 find(c==0)-1]))) The “intersect(fin d(c),...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.