Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

John D'Errico

View profile information

Company/University

Retired

Personal Profile

Mainly retired from Eastman Kodak. (Of course, Kodak itself is now semi-retired. I don't think I had any influence in that.) I still write MATLAB code as I find something interesting, and I do attempt to write new tools to put on the File Exchange when I think I can make a contribution.

However, I DON'T answer direct e-mail questions, and I do NOT do homework. In general, your homework is YOUR problem, not mine. Please do NOT e-mail me with your homework problems or student projects. If I was willing to answer your questions, I would very rapidly become overwhelmed, because one question is never just one simple question.

When I'm not doing something with MATLAB, you might find me playing bridge, either in the club or online on BBO.

Professional Interests: MATLAB, numerical analysis, mathematical modeling

Avocational interests: Bridge, woodworking, woodturning

Professional Interests

Bridge, MATLAB, numerical analysis, mathematical modeling

1687Rank
3Badges
385Score

John D'Errico submitted a Comment to Solution 926454

I try to avoid brute force solutions, but...

on 22 Jul 2016 at 18:47

John D'Errico received Creator badge for Problem 42914. Counting the Grand Primes

on 22 Jul 2016 at 18:20

John D'Errico submitted a Comment to Solution 917043

Of course, this solution use the formula from Carl Friedrich Gauss for the sum of the integers from 0 to n.

on 30 Jun 2016

John D'Errico submitted a Comment to Solution 916788

While the obvious solution is y = sum(1:2^x), that will fail miserably for x = 50. So the alternative is a looping solution, that generates the sum more intelligently. Here, the looping is done simply using recursion. In fact, we can even compute the exact sum for x =100, a problem that would take the brute force solution the lifetime of the universe. sum_int(sym(100)) ans = 803469022129495137770981046171215126561215611592144769253376 This done in fractions of a second, even for symbolic inputs.

on 30 Jun 2016

John D'Errico submitted a Comment to Problem 106. Weighted average

As the others have said, the problem title is flat out wrong. What is required is simply not a weighted average in any standard form.

on 17 Feb 2012

John D'Errico submitted Solution 34679 to Problem 167. Pizza!

on 9 Feb 2012

John D'Errico submitted a Comment to Solution 22539

cumsum(ones(1,10))

on 1 Feb 2012

John D'Errico submitted a Comment to Solution 11489

Of course, this solution, while short, is NOT the best solution! Clearly the best solution is the far more efficient: n*(n+1)/2

on 28 Jan 2012