I have an XML file with lots of nested data. One of the fields produces a single array of 1656 values that are stored in the XML as text. I can get the text as a string variable (a 8948 character array). How can I tell matlab to interpret this array as a 32 bit float array of 1656 values?
if char_data is the character array
I have tried: value_data = single(char_data);
but that converst each character to it's ascii value.
I have also tried: value_data = cast(char_data,'single');
and value_data = typecast(char_data,'single');
but all of these just convert the individual characters to their ascii values as single types.
it would seem I need to convert it to binary and tell matlab to interpret the block as the single array - but I am not seeing the functions to do that. I could write the text to a file, then read it with fread telling it the data type, but it would seem there should be a more direct way to do this.
Here is an example of the XML file:
<OPUSDataFile><AB__Multiple><Ydata ylabel="Absorbance Units" label="" block="0"><values byteorder="INTEL" format="FLOAT32" numvalues="1656">SX6TvL5Sk7yERZO8NE+TvDlNk7wZMZO8/RKTvFfskryPvZK8NLKSvDvOkrwNDZO8fkyTvIRtk7xJdJO87k+TvKk3k7wuR5O8iS+TvOcBk7yB3JK81tqSvKk3k7xSypO8R/GTvF5xk7zUcpO8wfWTvDi2k7yIKpO8jh6TvFO2k7z6bpS8QzeUvJSPk7zZiZO8XnuTvIgWk7y0jZO8cpaUvDSBlLwOspO8+VqT ...