I have successfully created a db in Matlab using the Visual Query builder (database toolbox). I am familiar with SQL and accessing key:value pairs with php and other languages, however I can’t find the syntax anywhere for Matlab. The code I have so far is:
conn = database('antoine_db','','');
c = catalogs(conn);
T = tables(conn);
cols = columns(conn);
sql_query = 'SELECT Formula,"Compound Name",A,B,C,TMIN,TMAX FROM antoine_data WHERE ID = 1';
result = fetch(conn,sql_query);
If ‘result’ here is a single row of data with multiple columns, how can I most easily access the data from a specific column? I can already do it by using the column index, such as result(1,1). What is the syntax in Matlab so I could access it by the column’s name, such as result[‘Name’]?
Try setting the return format to a structure: