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일

0 개 추천

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.

질문:

2012년 2월 21일

편집:

2013년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by