Got Questions? Get Answers.
Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
pcolor not working on my PC only.

Subject: pcolor not working on my PC only.

From: Jeff

Date: 22 Jan, 2010 18:40:29

Message: 1 of 13

Hi, it seems that pcolor is not working on my PC. But only on my PC.

I have some code that our professor gave us to simulate some cellular automata - whatever that is. pcolor is supposed to accept an array of 1s and 0s and color a figure based on the array. For every cell with a 1, it makes that pixel black; the other pixels remain white.

The program works on 2 different machines for him, but not on my PC (using Win Vista). I can see that the input array is correctly populated, but Figure 1 is just plain white on my PC.

What could be different about my PC, or my Matlab settings that would render pcolor impotent?

Thanks,
-Jeff

My code is probably too long for this forum, but here it is, anyway:

% One Dimensional Cellular Automata
% plot using pcolor() as 2D array where vertical direction is time

n=100; % size of the CA
t=101; % how many timesteps
k=2;
m=1;

a=zeros(t,n);
iv=0;

while iv<m,
    rc=round(rand(1)*n)+1;
    if a(1,rc) ==0
        a(1,rc)=1;
        iv=iv+1;
    end
end
   
for s=2:t-1,

    for c=1:n,
        cm=c-1;
        cp=c+1;
        if cm<1
            cm=n;
        end
        if cp>n
            cp=1;
        end
        a(s,c)=mod(a(s-1,cm)+a(s-1,cp),k);
    end
    
    pcolor(a);
    hold on;
    drawnow;
    
end

Subject: pcolor not working on my PC only.

From: Jeff

Date: 23 Jan, 2010 22:08:03

Message: 2 of 13

OK, it seems like I'm having some kind of graphics issue.

When I run the program, Figure 1 is the all white window I described. But if I select Edit - Copy Figure, it seems to highlight everything and then display the figure the way it should. Also, when I click on menu choices in the Figure1 window, they never go away (I can't select any of the options, but the menu is still displayed in the figure).

So this is some type of display issue. How can I fix this?

Thanks,
-Jeff

Subject: pcolor not working on my PC only.

From: Jan Simon

Date: 24 Jan, 2010 11:36:03

Message: 3 of 13

Dear Jeff!

> So this is some type of display issue. How can I fix this?

Do you have the newest drivers for your graphics card?
Did you (buy and) install the newest Matlab?

Good luck - it sounds not trivial :-( Jan

Subject: pcolor not working on my PC only.

From: Adam Pilchak

Date: 24 Jan, 2010 14:24:03

Message: 4 of 13

help pcolor

try changing from the default 'faceted' to 'interp'
It's helped me in the past when having display issues.


"Jeff " <spREMOVEHITSjeffAT@SIGNoptonline.net> wrote in message <hjcret$2fi$1@fred.mathworks.com>...
> Hi, it seems that pcolor is not working on my PC. But only on my PC.
>
> I have some code that our professor gave us to simulate some cellular automata - whatever that is. pcolor is supposed to accept an array of 1s and 0s and color a figure based on the array. For every cell with a 1, it makes that pixel black; the other pixels remain white.
>
> The program works on 2 different machines for him, but not on my PC (using Win Vista). I can see that the input array is correctly populated, but Figure 1 is just plain white on my PC.
>
> What could be different about my PC, or my Matlab settings that would render pcolor impotent?
>
> Thanks,
> -Jeff
>
> My code is probably too long for this forum, but here it is, anyway:
>
> % One Dimensional Cellular Automata
> % plot using pcolor() as 2D array where vertical direction is time
>
> n=100; % size of the CA
> t=101; % how many timesteps
> k=2;
> m=1;
>
> a=zeros(t,n);
> iv=0;
>
> while iv<m,
> rc=round(rand(1)*n)+1;
> if a(1,rc) ==0
> a(1,rc)=1;
> iv=iv+1;
> end
> end
>
> for s=2:t-1,
>
> for c=1:n,
> cm=c-1;
> cp=c+1;
> if cm<1
> cm=n;
> end
> if cp>n
> cp=1;
> end
> a(s,c)=mod(a(s-1,cm)+a(s-1,cp),k);
> end
>
> pcolor(a);
> hold on;
> drawnow;
>
> end

Subject: pcolor not working on my PC only.

From: Jeff

Date: 25 Jan, 2010 00:58:04

Message: 5 of 13

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hjhbb3$t7a$1@fred.mathworks.com>...
> Dear Jeff!
>
> > So this is some type of display issue. How can I fix this?
>
> Do you have the newest drivers for your graphics card?
> Did you (buy and) install the newest Matlab?
>
> Good luck - it sounds not trivial :-( Jan

I have V7.8.0.347, 32-bit for Windows. I'm using Windows Vista 64-bit. I'm working on the drivers for the graphics card now (Lenovo is not easy to deal with!).

Subject: pcolor not working on my PC only.

From: Jeff

Date: 25 Jan, 2010 01:48:03

Message: 6 of 13

I added 'shading interp' as the first line. Is that what you're recommending? I got the same results.

I also tried replacing pcolor(a) with image(a) and had a similar problem.

"Adam Pilchak" <adam.pilchak@gmail.com> wrote in message <hjhl63$mm8$1@fred.mathworks.com>...
> help pcolor
>
> try changing from the default 'faceted' to 'interp'
> It's helped me in the past when having display issues.
>
>
> "Jeff " <spREMOVEHITSjeffAT@SIGNoptonline.net> wrote in message <hjcret$2fi$1@fred.mathworks.com>...
> > Hi, it seems that pcolor is not working on my PC. But only on my PC.
> >
> > I have some code that our professor gave us to simulate some cellular automata - whatever that is. pcolor is supposed to accept an array of 1s and 0s and color a figure based on the array. For every cell with a 1, it makes that pixel black; the other pixels remain white.
> >
> > The program works on 2 different machines for him, but not on my PC (using Win Vista). I can see that the input array is correctly populated, but Figure 1 is just plain white on my PC.
> >
> > What could be different about my PC, or my Matlab settings that would render pcolor impotent?
> >
> > Thanks,
> > -Jeff
> >
> > My code is probably too long for this forum, but here it is, anyway:
> >
> > % One Dimensional Cellular Automata
> > % plot using pcolor() as 2D array where vertical direction is time
> >
> > n=100; % size of the CA
> > t=101; % how many timesteps
> > k=2;
> > m=1;
> >
> > a=zeros(t,n);
> > iv=0;
> >
> > while iv<m,
> > rc=round(rand(1)*n)+1;
> > if a(1,rc) ==0
> > a(1,rc)=1;
> > iv=iv+1;
> > end
> > end
> >
> > for s=2:t-1,
> >
> > for c=1:n,
> > cm=c-1;
> > cp=c+1;
> > if cm<1
> > cm=n;
> > end
> > if cp>n
> > cp=1;
> > end
> > a(s,c)=mod(a(s-1,cm)+a(s-1,cp),k);
> > end
> >
> > pcolor(a);
> > hold on;
> > drawnow;
> >
> > end

Subject: pcolor not working on my PC only.

From: Jeff

Date: 25 Jan, 2010 20:35:05

Message: 7 of 13

OK, I properly installed the student version of R2009a (v7.8.0.347) and I'm getting better results - the figure displays correctly now. However, the simple program runs very slow (it takes like a minute), and I'm still having other related issues. For example, after the program runs, I choose Edit - Copy Figure, and Matlab hangs.

I have also updated all of my graphics and BIOS device drivers.

Anyone have further thoughts on what's wrong? Can anyone tell me how long this simple program takes to run on your PC (mine is a 64-bit Windows with a quad Intel CPU)? My professor says it runs nearly instantly on his PC, but it takes like a minute to run on my PC.


"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hjhbb3$t7a$1@fred.mathworks.com>...
> Dear Jeff!
>
> > So this is some type of display issue. How can I fix this?
>
> Do you have the newest drivers for your graphics card?
> Did you (buy and) install the newest Matlab?
>
> Good luck - it sounds not trivial :-( Jan

Subject: pcolor not working on my PC only.

From: ImageAnalyst

Date: 25 Jan, 2010 22:49:11

Message: 8 of 13

On Jan 25, 3:35 pm, "Jeff " <spREMOVEHITSjef...@SIGNoptonline.net>
wrote:
> Anyone have further thoughts on what's wrong? Can anyone tell me how long this simple program takes to run on your PC (mine is a 64-bit Windows with a quad Intel CPU)? My professor says it runs nearly instantly on his PC, but it takes like a minute to run on my PC.


------------------------------------------------------------------------------------
Takes 28 or 29 seconds to run on my Dell dual core running 32 bit
WinXP.

Put a tic/toc in the code to see how long it really takes.
Maybe your prof has a really fast computer.

Subject: pcolor not working on my PC only.

From: Jody Klymak

Date: 26 Jan, 2010 00:12:03

Message: 9 of 13

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <50825865-a1f0-44ac-a465-20f84028f669@k22g2000vbp.googlegroups.com>...
> On Jan 25, 3:35 pm, "Jeff " <spREMOVEHITSjef...@SIGNoptonline.net>
> wrote:
> > Anyone have further thoughts on what's wrong? Can anyone tell me how long this simple program takes to run on your PC (mine is a 64-bit Windows with a quad Intel CPU)? My professor says it runs nearly instantly on his PC, but it takes like a minute to run on my PC.
>
>
> ------------------------------------------------------------------------------------
> Takes 28 or 29 seconds to run on my Dell dual core running 32 bit
> WinXP.

I get the same on a quad-core Mac.

If I put the pcolor call outside the for-loop it runs almost instantly.

Subject: pcolor not working on my PC only.

From: Jeff

Date: 26 Jan, 2010 05:19:03

Message: 10 of 13

"Jody Klymak" <jklymak@gmail.com> wrote in message <hjlc0j$72g$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <50825865-a1f0-44ac-a465-20f84028f669@k22g2000vbp.googlegroups.com>...
> > On Jan 25, 3:35 pm, "Jeff " <spREMOVEHITSjef...@SIGNoptonline.net>
> > wrote:
> > > Anyone have further thoughts on what's wrong? Can anyone tell me how long this simple program takes to run on your PC (mine is a 64-bit Windows with a quad Intel CPU)? My professor says it runs nearly instantly on his PC, but it takes like a minute to run on my PC.
> >
> >
> > ------------------------------------------------------------------------------------
> > Takes 28 or 29 seconds to run on my Dell dual core running 32 bit
> > WinXP.
>
> I get the same on a quad-core Mac.
>
> If I put the pcolor call outside the for-loop it runs almost instantly.

Thanks ImageAnalyst and Jody for the comparison runs.

Using tic/toc it took me about 34.3 seconds. I think my quad core 64-bit WinVista should run faster than you guys, but 34 sec. probably indicates I had a bad installation before.

My professor's PC is older than mine. I accidentally bought a monstrous quad-core since I had no idea what I was buying and my dad volunteered to help with the cost. :D (But it's really heavy to lug around school).

One (hopefully) last question: After you run the program (SAVE ALL YOUR IMPORTANT WORK, FIRST), if you click Edit - Copy Figure, do you get funny results like the menu doesn't go away for many minutes. If you click Edit - Copy Figure a second time, do you get memory errors that hang your Matlab? If so, there may be a general Matlab bug. I may call Matlab's tech support in the morning.

Once again, thanks,
-Jeff

Subject: pcolor not working on my PC only.

From: ImageAnalyst

Date: 26 Jan, 2010 13:14:21

Message: 11 of 13

Jeff:
I'm running R2010a prerelease. When I edit/copy the pulldown menu
goes away fairly quickly (2-3 seconds) but I get an hourglass and
nothing happens. When I look in the MATLAB command window it's
endlessly streaming hundreds of these:
"Windows returned error message: Not enough storage is available to
process this command."

If I hit control-c a bunch of times there, I can get it to quit, but
it barfs up this:

Warning: Failed in CloseEnhMetaFile, last error code 00000008 from-hDC
fd211810
> In C:\Program Files\MATLAB\R2010a\toolbox\matlab\graphics\hardcopy.p>hardcopy at 21
  In graphics\private\render at 143
  In print at 291
  In editmenufcn at 76
??? Operation terminated by user during ==> hardcopy after 21

In ==> render at 143
            pj.Return = hardcopy( inputargs{:} );

In ==> print at 291
                pj = render(pj,pj.Handles{i});

In ==> editmenufcn at 76
            uimenufcn(hfig, 'EditCopyFigure')

??? Interrupt while evaluating uimenu Callback.

Why don't you go ahead and report it.
-ImageAnalyst

Subject: pcolor not working on my PC only.

From: Jeff

Date: 26 Jan, 2010 20:43:04

Message: 12 of 13

Holy moly, Mathworks actually responds to bug complaints - and fast! What kind of company is this, anyway?

The answer is that the clipboard is running out of memory. When I - well, my professor - put the 'hold on' command inside the loop, he wanted to show us the progression of the code (they're called cellular automata, if that matters - which it doesn't).

But putting 'hold on' inside the loop preserves all the information from all the drawings - 100 rows x 100 columns redrawn 100 times - and then tries to import that into the clipboard. Matlab is working fine; Windows clipboard isn't that big.

I removed the 'hold on' line and I was still able to see the progression, so I don't know why it was in there.

Thanks all for your help. I have to go now and read up on 'hold on'.
-Jeff

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <060daddc-c98c-4689-bd0e-911d17062fb7@a6g2000yqm.googlegroups.com>...
> Jeff:
> I'm running R2010a prerelease. When I edit/copy the pulldown menu
> goes away fairly quickly (2-3 seconds) but I get an hourglass and
> nothing happens. When I look in the MATLAB command window it's
> endlessly streaming hundreds of these:
> "Windows returned error message: Not enough storage is available to
> process this command."
>
> If I hit control-c a bunch of times there, I can get it to quit, but
> it barfs up this:
>
> Warning: Failed in CloseEnhMetaFile, last error code 00000008 from-hDC
> fd211810
> > In C:\Program Files\MATLAB\R2010a\toolbox\matlab\graphics\hardcopy.p>hardcopy at 21
> In graphics\private\render at 143
> In print at 291
> In editmenufcn at 76
> ??? Operation terminated by user during ==> hardcopy after 21
>
> In ==> render at 143
> pj.Return = hardcopy( inputargs{:} );
>
> In ==> print at 291
> pj = render(pj,pj.Handles{i});
>
> In ==> editmenufcn at 76
> uimenufcn(hfig, 'EditCopyFigure')
>
> ??? Interrupt while evaluating uimenu Callback.
>
> Why don't you go ahead and report it.
> -ImageAnalyst

Subject: pcolor not working on my PC only.

From: ImageAnalyst

Date: 26 Jan, 2010 20:56:51

Message: 13 of 13

OK - I didn't expect that. Pretty tricky. Glad you/they got it
figured out.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us