Matlab

49 shades of gray

Linear:

temp = linspace(0,1,49);

figure

for ii = 1:49

subplot(7,7,ii)

h = fill([0 0 1 1], [0 1 1 0], [temp(ii) temp(ii) temp(ii)]);

set(h,’EdgeAlpha’,0)

axis square

axis off

end

49 shades of gray, linear

49 shades of gray, linear

Log:

temp = (logspace(0,1,49)-1)./9;

figure

for ii = 1:49

subplot(7,7,ii)

h = fill([0 0 1 1], [0 1 1 0], [temp(ii) temp(ii) temp(ii)]);

set(h,’EdgeAlpha’,0)

axis square

axis off

end

49 shades of gray, log

49 shades of gray, log

Matlab for Neuroscientists

Matlab for Neuroscientists

9 Responses to Matlab

  1. Chris Fink says:

    Dear Professor Wallisch,

    I am preparing to use your textbook to teach an introductory “Computational Neuroscience” course at Ohio Wesleyan University. It appears to be an excellent resource, and I can’t wait to use it.

    As I was going through Chapter 16, I found one small error in the m-file Chap16_PopVectorTrain.m. Line 35 reads

    param(n,:) = nlinfit(ang,spikeCount,myfun,[1 1 0])’;

    and generates the following error:

    ??? Error using ==> nlinfit at 126
    MODELFUN should return a vector of fitted values the same length as Y.

    Error in ==> Chap16_PopVectorTrain at 35
    param(n,:) = nlinfit(ang,spikeCount,myfun,[1 1 0])’;

    I found that this is due to ‘ang’ being a row vector, while ‘spikeCount’ is a column vector. Transposing therefore spikeCount results in the program running perfectly. I just thought you might like to know this for the future. By the way, I’m glad I had the opportunity to search for you, because I very much enjoy your blog, and have added it to my list of favorites.

    Cheers,

    Chris

    • Lascap says:

      Dear Dr. Fink,

      thank you for bringing this to my attention.This will be fixed in a future release. Please let me know if you find any other errors.

      I’m glad you find the book (and the blog) to be of interest!

      Thanks again,
      Pascal

  2. Anonymous says:

    Dear Dr. Wallisch,
    I have just started using the Second Edition of the book to teach myself MATLAB. I was very happy to see that everything is quite accessible to even those who have no prior background in programming or math, like myself. The one issue I have is that in the book it is stated that the solutions to the exercises are on the companion website for the book. However, they really aren’t, as far as I can see. I contacted Elsevier support about this, and all they said was that somebody else contacted them with the same question a while ago and the problem has not been resolved (well, obviously). I was wondering if the solutions exist somewhere else on your personal websites etc., or if there is any other way of accessing them. As I am doing this by myself rather than in a class setting, it is really essential to be able to check my answers.
    Thanks.
    Best,
    Elif

    • Rojin Sharif says:

      Hello,

      I have the same problem. I can’t find the answers. Is the problem solved for you Elif?

      Best regards,
      Rojin

  3. Dear Dr. Wallisch,
    I’m doing student projects and industrial
    A team from the University have provided good
    Visit my website:
    http://www.matlabi.ir
    I’m glad your comment about this announce

  4. Hello
    I agree with all my comments. Programming is a very difficult process and process and requires university education.

  5. Dear Dr. Wallisch, I am working on the same subject, Thanks for sharing your matlab code

  6. I agree with all my comments. Programming is a very difficult process and process and requires university education.

  7. Dear Dr. Wallisch,
    I’m doing student projects and industrial
    A team from the University have provided good

Leave a Reply

Your email address will not be published.


seven + = 12