Recode values before reaching a certain value and not after in struct field matlab

  Kiến thức lập trình

I have a struct called “x”. x has several fields within it. One of these is known as “type” (i.e., x.type). type is a character field. Below is an example of what the data in x.type looks like:

'boundary'
'E  3'
'E  5'
'E  3'
'E  5'
'E  3'
'E  5'
'E 24'
'E 40'
'E 65'
'boundary'
'E 48'
'E132'
'E 48'
'E132'
'E 48'
'E130'
'E 48'
'E130'

I want to rename all the values before ‘E 48’ with ‘E999’ and to leave ‘boundary’ the values after ‘E 48’ as they are.

I’m mostly an R user, so not too sure how to do this in Matlab.

Any tips would be appreciated!

LEAVE A COMMENT