Path: news.mathworks.com!not-for-mail
From: Mike Karr <mkarr@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: evalin working in debug but not in run time
Date: Tue, 28 Jul 2009 07:56:56 -0400
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <h4mp28$e53$1@fred.mathworks.com>
References: <h2uths$p3o$1@fred.mathworks.com>
NNTP-Posting-Host: mkarr-deb4-64.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1248782216 14499 144.212.105.163 (28 Jul 2009 11:56:56 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 28 Jul 2009 11:56:56 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.11) Gecko/20070217 Iceape/1.0.8 (Debian-1.0.8-4)
In-Reply-To: <h2uths$p3o$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:558938


Andy wrote:
> Hi
> 
> I have a GUI that plots market data as candlestick chart. When the user populates the list box fields next to the chart and clicks a command button, a connection to a thrid party market data application is opened and the data is collected. For various reasons to do with the way the .m files for connecting and getting this data work, I am assigning the resulting four column matrix of data to the base workspace. This all works fine and I can see the correctly sized variable containing the correct data in the base workspace.
> 
> I then need to get this data into the workspace of the .m file for the GUI, which I have done by putting the following line in that .m file:
> 
> ts1=evalin('base', 'OHLC');
> 
> If I put a break point on that line and run in debug mode, the code executes perfectly - 'OHLC' is assigned to 'ts1' correctly and the rest of the code that plots the chart also functions correctly.
> 
> However at run time evalin does not work. The code executes without throwing errors but the variable in the base workspace is not copied to ts1. The chart plots the data previously requested. (E.g. if the new request is for 100 bars of data and the previous request was for 50, if plots the 50 bars, not the 100)
> 
> Bizarrely, if the user clicks the command button in the GUI twice then the correct data plots OK. 
> 
> I have tried putting a breakpoint on the line below the one above. When execution halts there I can see that 'OHLC' in the base workspace is correct, but 'ts1' has stale values. Apart from anything else I can't think where it is getting those values from, as I have put 'clear ts1' near the end of the function.
> 
> Any suggestions very gratefully received.

If this problem is not resolved, we would appreciate it if you would 
file a bug report,
providing enough files and instructions to reproduce the problem.

apologies for the late response and for the difficulties,
mike