Getting started with Matlab and mySQL, as a result for my query I get this type of array:
my_result =
5×1 cell array
{'a'}
{'b'}
{'c'}
{'d'}
{'e'}
I'd like to get a simple array like this:
[a, b, c, d, e]
Here's my code:
mysql( 'open', 'my_database', 'usr','passw' )
query = fileread('query1.sql');
query = sprintf(query)
my_result = mysql(query);
And my attempts at getting a simple array:
my_array = []
for i=1:length(my_result)
my_array = [my_array, my_result{i}];
end
>> my_array
my_array =
'abcde'
>> cell2mat(my_result)
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});
Is there a way to either get the correct format in the first place, or easily convert it properly? Thank you