Hi Mimmi,
It appears that the error is occurring because the “ttest” function in MATLAB expects numeric arrays as input, whereas the data is currently in the form of a table, which is the typical output format from “spreadsheetDatastore”.
To resolve this, the table data can be converted into a numeric array using the “table2array” function before passing to “ttest”.
Assuming the data is loaded as:
ds1 = spreadsheetDatastore('control.xlsx');
ds2 = spreadsheetDatastore('treated.xlsx');
Read the data as:
tbl1 = read(ds1);
tbl2 = read(ds2);
Now, convert the tables to numeric arrays (if the tables only contain numeric data):
X = table2array(tbl1);
Y = table2array(tbl2);
Finally, apply “ttest” by passing X and Y to the “ttest” function.
For more information on the functions mentioned above, please refer to following the documentation links:
