Undefined operator './' for input arguments of type 'handle.handle'
Afficher commentaires plus anciens
Hi,
I have the following code to calculate daily returns:
dates = datenum(AIG.DatesAtStartOfPeriod, 'dd/mm/yyyy');
formatOut = 'mmm-yyyy';
DateString = datestr(dates,formatOut);
T = [AIG, GE, IBM];
symbol = {'AIG','GE','IBM'};
nAsset = numel(symbol);
When I try calculating these returns with:
ret = T(2:end,:)./T(1:end-1,:)-1
I get the error:
"Undefined operator './' for input arguments of type 'handle.handle'"
When I replace this with the following function:
ret = tick2ret(T{:,symbol});
I get the following error:
"Brace indexing is not supported for variables of this type"
I would appreciate your assistance on what I may be overlooking - many thanks.
2 commentaires
Matt J
le 21 Oct 2024
Your posted code doesn't reveal anything about what T is. Best would be to attach it in a .mat file so we can examine it for ourselves.
Image Analyst
le 21 Oct 2024
Modifié(e) : Image Analyst
le 21 Oct 2024
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
So, before the error do
save('answers.mat', 'T', 'AIG', 'GE', 'IBM');
and attach the answers.mat file with the paperclip icon in your original question.
By the way AIG is a structure (or a class) so if
T = [AIG, GE, IBM];
worked then T, GE, and IBM must also be structures or classes of the same type. And you can't divide a structure by a structure. There are many elements to a structure and it can't just divide all matching field names - it wouldn't make sense in the general case.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Cell Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
