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

조회 수: 2 (최근 30일)
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?

답변 (1개)

Peter Perkins
Peter Perkins 2015년 11월 12일
It sounds like maybe you want to use join, or ismember.

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by