date time machine power energy heat
? ? ? MW kJ kJ
2/15/2016 20:50:46 kuka 45 22 22
2/15/2016 20:50:47 kuka 50 24 22
2/15/2016 20:50:48 kuka 56 26 22
2/15/2016 20:50:49 kuka 58 28 22
2/15/2016 20:50:50 kuka 62 30 22
2/15/2016 20:50:51 kuka 60 32 22
2/15/2016 20:50:52 kuka 64 34 20
I have a textfile and I imported data using importdata() command in matlab
I have tried Delimiter with space ' ' and '\t'
All data is saved in a struct as fine I as need but the problem is in the first line all of it is saved in one cell like date time machine power energy heat
All of the other data like ? , MW , KJ and 45 are save in separate cells which are fine.
I want data from the first row as separate entities like data time machine etc
If I save that cell in a variable name X then output is like 'date time machine power energy heat'
When I check class of this its char
What I want know is to convert this char to a string so that I can continue writing code for my GUI
String == Character arrayin MATLAB, (but you also have cell arrays of strings).stringand use that one, but I would not recommend it to anyone who actually want his code to work well (someone may have done it since he thought it prettier , but this person have likely paid the price in blood). Matlab have a lot of functions which deals with "cell arrays of strings". And writing a custom string clase would not only be slow, but also force you to rewrite all functions handling strings as char arrays (and also "cell array of strings").datetimeandmachineetc to store in separate variables