Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is it a bug in MATLAB 2008A?

65 views
Skip to first unread message

damayi

unread,
Jul 6, 2008, 11:52:28 AM7/6/08
to
Dear all
I encountered a very strang problem and I hope you can help me.
I developed an application with MATLAB 2007B, and one part of this
application is to plot a figure, and its structure is as the
following:

h = figure(1); % set up a figure
set(h,'Visible', 'off'); % set this figure hide, since I will plot a
lots
....
plot3(x,y,z); % use plot3 to draw my data curve, some other plot
attributes not mentioned here.
....
set(gca,'view',[0, 90]); % view as XY
xlim([x1 x2]); % config X scope
set(h,'Visible','on'); % plotting completed, let it show.

I run this application many times in 2007B, at least 1000, may be
more. And all of them are OK. However, today I run it in 2008A, and a
strange thing occured. That is: The latter part of curve can not be
displayed. For example, I want to plot X-axis from 0 to 5000, it only
shows from 0 to 4010 around. Clicking the 'Pan'(like a hand on figure
toolbar), and then drag the plot to left, then the left part which not
displayed will show.
Someimes, after running my application the first time, and use 'Pan'
to show the unshown part, then I close plot figure and run above
application again, then MATLAB can give me a completed show.
Really very strange and confused, isn't it?

Back to the detailed code, If not config 'Visible' to 'off' when
setting up a figure, then all the thing is OK.
Considering that my application has been OK in MATLAB 2007B, and there
is problem in MATLAB2008A, so I think maybe it is a bug in 2008A. Any
advice will be my pleasure.

Best Regards
mayi
2008-07-06

Bruno Luong

unread,
Jul 6, 2008, 3:39:01 PM7/6/08
to
The following code works fine to me (2008a, Vista)

h = figure(1);


set(h,'Visible', 'off');

x=1:10:5190;
y=sin(x/100);
z=cos(x/100);
plot3(x,y,z)


set(gca,'view',[0, 90]);

xlim([1 5200]);


set(h,'Visible','on');

% Bruno

damayi

unread,
Jul 6, 2008, 7:38:26 PM7/6/08
to
Your code works fine on my computer too. (MATLAB 2008A version).
I think my problem is not a very obvious one, since there are so many
persons who use MATLAB and obvious bug can be found very easily.
The code that I mentioned is just a simple case to illustrate my
question. Actrually, my code is very long, and after setup a figure,
many other attributation was configured to figure, axes and plot. For
that my code is long and large, so I did not write it out.
What I am confused is Why my code works fine in 2007B but not in
2008A.

Best Regards
mayi
2008--7-7

dpb

unread,
Jul 6, 2008, 7:43:12 PM7/6/08
to
damayi wrote:
...

> Back to the detailed code, If not config 'Visible' to 'off' when
> setting up a figure, then all the thing is OK.
> Considering that my application has been OK in MATLAB 2007B, and there
> is problem in MATLAB2008A, so I think maybe it is a bug in 2008A. Any
> advice will be my pleasure.
...

If you have current maintenance, I'd suggest cutting the code down to as
minimum as possible w/ instructions on how to reproduce the symptoms and
submit it to TMW.

However, of course, it could quite possibly be something in your
particular video display/driver, etc., ...

--

damayi

unread,
Jul 7, 2008, 3:36:42 AM7/7/08
to

I have upload my test code at http://sites.google.com/site/damayi/matlab
There are three files, one file is my code, the other two files are my
figure results.
At the same time, I show my code in the following (the contents is
same as above file). Since that many tab characters in my code, it
seems to be not neat :) I'd like to suggest you get my code at my
personal site mentioned above.

In my computer, when I run 'TestIt.m' the first time, the data curve
does not show completed. And cannot see the full legend. However,
after running it many times, or occasionally, it will show the full
curves and legends.

Best Regards
mayi
2008-7-7

function TestIt()
[Ts yDATA] = LoadData();

FigureHandle = SetupFigure('My Name');
subplot(1,1,1);
AllHandle = DrawZonePlot(Ts, yDATA, 'Time(ms)', 'Y', 'Z', 'Plot my
data', {'A','B','C'});
SetConfigToPlot(AllHandle);
set(FigureHandle,'Visible','on');
return;

function [Ts yDATA] = LoadData()
Ts = [0:5:5000]*0.02/20;
Ts = Ts(:);
WT = 2*pi*Ts;
yDATA = [sin(WT),1.5*sin(WT-2*pi/3),1.8*sin(WT+2*pi/3)];
return;


function SetConfigToPlot(AllHandle)

set(AllHandle.PlotHandle, ...
'LineStyle', '-', ...
'LineWidth', 1, ...
'Marker', '.', ...
'MarkerSize', 6);

LegendStr = struct( 'Interpreter', 'None', ...
'Visible', 'on', ...
'Orientation', 'vertical', ...
'Location', 'NorthEast');
set(AllHandle.LegendHandle, LegendStr);

AxesGridStr = struct('XGrid', 'on', 'YGrid', 'on', 'ZGrid','on');

set(AllHandle.AxesHandle, AxesGridStr, ...
'XAxisLocation', 'bottom', ...
'YAxisLocation', 'left', ...
'View', [0 90]);
return;


function AllHandle = DrawZonePlot(Ts, yDATA, TimeName, yName, zName,
tName, lName)
hp = plot3(Ts, yDATA, zeros(size(Ts)));
set(gca,'XLim', [Ts(1) Ts(end)]);
hx = xlabel(TimeName);
hy = ylabel(yName);
hz = zlabel(zName);
AxesTag = 'TimeX';

ht = title(tName);
hl = legend(lName);
set(gca, 'Box', 'off', 'Tag', AxesTag, 'ButtonDownFcn',
@ClickOnAxes);
set(hp, 'Tag', 'DataLine');

AllHandle = struct( ...
'FigHandle', gcf, ...
'AxesHandle', gca, ...
'PlotHandle', hp, ...
'TitleHandle', ht, ...
'LegendHandle', hl, ...
'XLabelHandle', hx, ...
'YLabelHandle', hy, ...
'ZLabelHandle', hz );
return;

function h = SetupFigure(FigName)
persistent FigNum;
if isempty(FigNum)
FigNum = 1;
else
FigNum = FigNum + 1;
end

h = figure(FigNum);
set(h, 'Visible', 'off', ...
'Tag', 'DataFigure', ...
'ToolBar', 'figure', ...
'MenuBar', 'figure', ...
'DockControls', 'off', ...
'color', 'white', ...
'Name', FigName, ...
'NumberTitle', 'off');
movegui(h, 'center');
return;

Titus

unread,
Jul 7, 2008, 6:03:11 AM7/7/08
to
Hi Mayi,

I tried your code and everything works fine for me (R2008a, Windows XP). I
would suggest to contact the technical support of The MathWorks who should
be able to help you track down the source of your problem. You will find the
contact information at
http://www.mathworks.com/support/contact_us/index.html

Titus

"damayi" <dam...@gmail.com> schrieb im Newsbeitrag
news:d5f9cff6-6359-47e3...@z66g2000hsc.googlegroups.com...

damayi

unread,
Jul 7, 2008, 10:51:49 AM7/7/08
to
On Jul 7, 6:03 pm, "Titus" <titus.edelho...@mathworks.de> wrote:
> Hi Mayi,
>
> I tried your code and everything works fine for me (R2008a, Windows XP). I
> would suggest to contact the technical support of The MathWorks who should
> be able to help you track down the source of your problem. You will find the
> contact information athttp://www.mathworks.com/support/contact_us/index.html
>
> Titus
>
> "damayi" <dam...@gmail.com> schrieb im Newsbeitragnews:d5f9cff6-6359-47e3...@z66g2000hsc.googlegroups.com...

> On Jul 7, 7:43 am, dpb <n...@non.net> wrote:
>
>
>
>
>
> > damayi wrote:
>
> > ...> Back to the detailed code, If not config 'Visible' to 'off' when
> > > setting up a figure, then all the thing is OK.
> > > Considering that my application has been OK in MATLAB 2007B, and there
> > > is problem in MATLAB2008A, so I think maybe it is a bug in 2008A. Any
> > > advice will be my pleasure.
>
> > ...
>
> > If you have current maintenance, I'd suggest cutting the code down to as
> > minimum as possible w/ instructions on how to reproduce the symptoms and
> > submit it to TMW.
>
> > However, of course, it could quite possibly be something in your
> > particular video display/driver, etc., ...
>
> > --
>
> I have upload my test code athttp://sites.google.com/site/damayi/matlab
> return;- Hide quoted text -
>
> - Show quoted text -

Thanks for your testing.
My computer is Thinkpad R60(Core2 CPU T5600 1.83G, RAM 3G) and OS is
Windows XP with SP3.

damayi

unread,
Jul 12, 2008, 7:30:18 AM7/12/08
to
> Windows XP with SP3.- Hide quoted text -

>
> - Show quoted text -

Yesterday, another friend who use MATLAB 2008A, run my code and get
the same result that I mentioned. So I think it is a really bug in
2008A. I hope Mathworks can see this post and resolve it in the next
release version.

Best Regards
mayi
2008-7-12

per isakson

unread,
Jul 12, 2008, 9:59:03 AM7/12/08
to
damayi <dam...@gmail.com> wrote in message

> Yesterday, another friend who use MATLAB 2008A, run my
code and get
> the same result that I mentioned. So I think it is a
really bug in
> 2008A. I hope Mathworks can see this post and resolve it
in the next
> release version.
>
> Best Regards
> mayi
> 2008-7-12


I downloaded your files and reproduced the "cropped" plot
of your file (1.rar).

With "visible on" throughout the process I get the expected
result.

BTW: Use the end keyword to end functions.

/per

>> ver
MATLAB Version 7.6.0.324 (R2008a)
OS: Microsoft Windows XP Version 5.1 (Build 2600: SP3)
Java VM Version: Java 1.6.0 with Sun Microsystems Inc.
Java HotSpot(TM) Client VM mixed mode

damayi

unread,
Jul 12, 2008, 3:46:32 PM7/12/08
to

Thanks for your enthusiastic help and your advice.
With your testing result, I am sure that there must be a bug in MATLAB
2008A.
How can I report this bug to Mathworks Team?

My ver infomation is below:
-------------------------------------------------------------------------------------
MATLAB Version 7.6.0.324 (R2008a)
MATLAB License Number: xxxxxxx
Operating System: Microsoft Windows XP Version 5.1 (Build 2600:
Service Pack 3)


Java VM Version: Java 1.6.0 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM mixed mode

-------------------------------------------------------------------------------------

per isakson

unread,
Jul 12, 2008, 4:54:02 PM7/12/08
to
damayi <dam...@gmail.com> wrote in message <7edf73c5-0ad7-
40e8-b4b3-d...@r66g2000hsg.googlegroups.com>...
> On Jul 12, 9:59=A0pm, "per isakson"
-----------------=

> ----------
> MATLAB Version 7.6.0.324 (R2008a)
> MATLAB License Number: xxxxxxx
> Operating System: Microsoft Windows XP Version 5.1 (Build
2600:
> Service Pack 3)
> Java VM Version: Java 1.6.0 with Sun Microsystems Inc.
Java
> HotSpot(TM) Client VM mixed mode
> ----------------------------------------------------------
-----------------=
> ----------

Use

http://www.mathworks.com/support/bugreports/

/ per

Bruno Luong

unread,
Jul 13, 2008, 5:58:02 AM7/13/08
to
damayi <dam...@gmail.com> wrote in message
<7edf73c5-0ad7-40e8...@r66g2000hsg.googlegroups.com>...

> Thanks for your enthusiastic help and your advice.
> With your testing result, I am sure that there must be a
bug in MATLAB
> 2008A.

It seems that the clipping is somehow related to the command
movegui. Instead of calling movegui where it was, I put
movegui right before Visible is set on

movegui(FigureHandle, 'center');


set(FigureHandle,'Visible','on')

(Delete the command movegui in SetupFigure)

Then everything seems fine. Is it a work around?

Bruno

damayi

unread,
Jul 13, 2008, 11:49:40 AM7/13/08
to
On Jul 13, 5:58 pm, "Bruno Luong" <b.lu...@fogale.fr> wrote:
> damayi <dam...@gmail.com> wrote in message
>
> <7edf73c5-0ad7-40e8-b4b3-d805938fa...@r66g2000hsg.googlegroups.com>...

>
>
>
> > Thanks for your enthusiastic help and your advice.
> > With your testing result, I am sure that there must be a
> bug in MATLAB
> > 2008A.
>
> It seems that the clipping is somehow related to the command
> movegui. Instead of calling movegui where it was, I put
> movegui right before Visible is set on
>
>     movegui(FigureHandle, 'center');
>     set(FigureHandle,'Visible','on')
>
> (Delete the command movegui in SetupFigure)
>
> Then everything seems fine. Is it a work around?
>
> Bruno

You are so great :) Just now, I modified my code according to your
advice, and I get the correct plot result. Thanks very much.
It also proved that there is really a bug in MATLAB 2008A.

Regards
mayi
2008-07-13

per isakson

unread,
Jul 13, 2008, 2:14:02 PM7/13/08
to
damayi <dam...@gmail.com> wrote in message
<snip>

> It also proved that there is really a bug in MATLAB 2008A.

Did you report it?
/ per

damayi

unread,
Jul 14, 2008, 3:45:40 AM7/14/08
to

I have reported it to Mathworks throught website, but it still a
unsigned status now. I don't know when it will come into Mathworks
developer's eyes. :) God bless.


0 new messages