class corruption
2 views (last 30 days)
Show older comments
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 Comment
Answers (1)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!