Assignment with 0 - Alternative

1 visualización (últimos 30 días)
BdS
BdS el 30 de Abr. de 2019
Hi everybody,
I have got the following code:
PortMembers=369x1 cell with ISINS
GlData.instrISIN(:,1) = 1640x1 cell with ISIS
rebRankings=NaN(nDates,nPortMembers,nFactors);
% create matrix with rankings on rebalancing dates only
[~,ind]=ismember(PortMembers(:,1),GlBbgRawData.instrISIN(:,1));
rebRankings(dRebInd,:,:)=GlBbgRawData.factorRanks(:,ind,:);
The resulting variable ind contains one 0 because the ISIN xxx in PortMembers is not available in GlData.instrISIN(:,1). In this particular case, it means that ISIN in PortMembers on 'place' 349x1 in not available in GlData.instrISIN(:,1). In such cases I would like to insert NaNs in rebRankings. It means, rebRankings(dRebInd,349,:) would contain NaNs.
Do you know any elegant solutions for those kind of questions? (if possible, no iterations.)
Thanks in advance.

Respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by