Converting a comma separated list into an array concatenates them.
93 views (last 30 days)
I was trying to convert a comma separated list of strings into a normal array. So B0005.cycle is a struct with some fields:
B0005.cycle.type is a comma separated list:
I tried to convert it into an array by doing this: [B0005.cycle.type] but it gives this output:
However I want ["charge", "discharge","charge","discharge",...]. So how do I go about this?
I have attached the mat file below.
Atul Upadhyay on 19 Jun 2020
I can see that you are trying to convert a comma separated list of strings to normal array. You can do it like following.
Refer to the following documentation to know more about comma-separated lists in MATLAB.