class corruption

2 ビュー (過去 30 日間)
Angus
Angus 2012 年 2 月 21 日
編集済み: Matt J 2013 年 10 月 20 日
Hi all,
I have a set of classes all of which inherit the handle class. For simplicity I'll focus on the stock class and the portfolio class.
The stock class has a set properties that define a stock (ticker, shares, prices, etc).
The portfolio class has a set of properties that define the portfolio at a given point in time (holding date, holdings (cell array of stock objects), marketvalue, etc.).
I have a simulation where I give portfolio a starting portfolio of stock. The constructor still works and I can populate an initial portfolio port with 50 stocks. I have two methods that invest and divest (buy and sell) stocks as I walk forward in time and feed it a list of stock objects to add or remove. The following is the invest method.
function investStock(obj, stockobj) obj.holdings(end+1) = {stockobj}; end
Until 8:0am today I was able to simulate through and have my initial portfolio adjust through time to a set of buys and sells and end up with the final portfolio being the cumulative sum of buys and sell. Everything was working perfectly and I had tested each method, each bit of code as I added it. I disconnected my computer at home, brought it to work, made ZERO changes to the code and now it does not work.
It appears as if the classes / matlab have become corrupted. I've shut down and restarted to clear out memory. No luck. I deleted the asv files. Again nothing. Does matlab keep a copy of my classes resident somewhere or does anyone have any clue as to what might have happened?
I had a former colleague who had something similar happen in the past an he was also stumped and completely reinstalled matlab, which seems like a drastic solution.
Regards
  1 件のコメント
per isakson
per isakson 2012 年 2 月 22 日
Any error messages? What happens when it "does not work"?

サインインしてコメントする。

回答 (1 件)

Angus
Angus 2012 年 2 月 21 日
As some additional information on this problem, I tried completely recreating the class files, named as something else; e.g. StockNEW, portfolioNEW, etc. I didn't do a save as but copy-patste the text into a new file and modified.
All objects should be of a new file type and thus shouldn't be effected by any possible corruption within matlab resident in memory. Nothing. Same exact problem.
Any idea or help would be greatly appreciated.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by