MATLAB is amorphous on type -- everything is stored as the type of the RHS on assignment unless directly addressing the element of an existing array of a particular type.
There's no concept of defining the type of the field of a struct; it takes on the type of the object stored in it on assignment.
So, you'll have to convert the data to the proper type before the assignment -- where to do that is probably at the point you read in the content of the splitx array from file if that's how it's input or with additional code besides just split which returns string array if that's where it originates.
We can't answer the specifics of the case not knowing those details...need code and example data (and as text, not images; can't do anything with images)
To illustrate, consider the following code snippet--
>> clear s
>> s.A='Fred';
>> s(2).A=2;
creates a struct array s whose field A contains data of different types. To prove it really works that way..
>> arrayfun(@(s) disp(s.A),s)
Fred
2.00
>>
So, the field A in the struct array s has a different data type in the two elements of the struct array. There's no knowledge on storage that the existing array fields have a particular type associated with the field name in another element of the array, nor is there any way to define a type for the field.
Continuing on the above example...
>> s(1).A=pi;
>> arrayfun(@(s) disp(s.A),s)
3.14
2.00
>>
and the conversion to double occurred silently...MATLAB simply stores what it's asked to store.
OTOH, consider
>> clear s; s=rand(3,1);
>> whos s
Name Size Bytes Class Attributes
s 3x1 24 double
>> s(2)='Fred';
Unable to perform assignment because the left and right sides have a different number of elements.
>> s(2)={'Fred'}
Conversion to double from cell is not possible.
>> s(2)="Fred";
>>
OK, the first two acted like we would expect -- a char() string is an array so can't put more than one element of a 4x1 char array into one location. The second seems self-explanatory.
What the heck happened with the last??? No error but string "Fred" certainly is NOT numeric--so what gives?
>> whos s
Name Size Bytes Class Attributes
s 3x1 24 double
>> s
s =
0.87
NaN
0.70
>>
The array is still an array of doubles but the string class has extra features -- it tries to convert to the target numeric class and if can't just says it's "Not a Number". Internally, it's as if wrote
from the result.
>> s(2)="3.14"
s =
0.87
3.14
0.70
>>