I have a cell array which contains some descriptions, namely my_des.
my_des = [{'FRD'} {'1'}; {'UNFRD'} {'2'}; {'OTH'} {'3'};];
I also have an approximately 5000x1 cell array. The elements in this array are either 'FRD', 'UNFRD' or 'OTH'.
What I want to do is replace these text values with the corresponding numeric values in my_des.
Currently my only idea (which I think isn't that great) is to loop through my_des and do a string replacement.
Example:
So say my current vector looks like this:
FRD
FRD
OTH
UNFRD
OTH
FRD
Then my desired output would be this:
1
1
3
2
3
1
The numbers come from the my_des array
'1','2','3'not exist in your original array? If those values are coming frommy_des, why dont you simply select the second column?