MATLAB Answers

0

How to Replace certain elements of table column with corresponding values of another array of different size?

Asked by Andrei Makarskiy on 10 Nov 2015
Latest activity Answered by Peter Perkins
on 12 Nov 2015
I have a categorical table variable alloptions.Exp (96399 rows) having such values as:
'Mar1 15'
'Mar1 15'
'Mar1 15'
'Mar1 15'
'Mar 15'
'Mar 15'
'Mar 15'
'Apr1 15'
'Apr2 15'
'Apr 15'
'Apr4 15'
'May1 15'
'May2 15'
'May 15'
'May4 15' ....
and I have a 119x2 Expiration_Table array having these values:
'Mar1 15' '06-Mar-2015'
'Mar2 15' '13-Mar-2015'
'Mar 15' '20-Mar-2015'
'Mar5 15' '31-Mar-2015'
'Apr1 15' '02-Apr-2015'
'Apr2 15' '10-Apr-2015'
'Apr 15' '17-Apr-2015'
'Apr4 15' '24-Apr-2015'
'May1 15' '01-May-2015'
.....
What I need is to create another table variable alloptions.ExpDate having the corresponding values from the Expiration_Table(:,2)
Is there a nicer way to do it by not using loops?

  0 Comments

Sign in to comment.

1 Answer

Answer by Peter Perkins
on 12 Nov 2015

It sounds like maybe you want to use join, or ismember.

  0 Comments

Sign in to comment.