How to include string + numbers in a table using a for...end routine
1 view (last 30 days)
Show older comments
Dear experts,
I am a physician and a poor matlab programmer. Nevertheless, I am trying to constract a program that automatically reads multiple excel files, each containing data from exercise stress tests of patients.
I have programmed already the routine that reads nicely one such excel file and extracts the following variables:
Results=[Name, ID, Date, Age, sex, ESTdur, TargetHR, METs, STlevel, STslope, HR_EST, SBP_EST, DBP_EST]
This is an output of one patient.
Name, ID, Date, Age, sex, ESTdur, TargetHR, METs, STlevel, STslope, are all string variables
HR-EST, SBP_EST and DBP_EST are 3 numeric arrays, each containing 26 numbers of heart rate, systolic and diastolic blood pressures, all converted to cells (or strings).
I am trying to collect the above Results output for many patients (thousands) and put all of the in a table such that each patient is one raw.
I wrote a for.....end routine that can read many excel files.
My problem however is that when I try to include each patient in the matrix FResults by: FResults(f,:)=Results
I get an error message of mismatch : "Conversion to double from cell is not possible."
How should I do that properly??
Thank you in advance. Giora
.
0 Comments
Answers (3)
Jeremy
on 4 Dec 2019
It sounds like you might want to use the command
readtable
This will read your entire spreadsheet as a table data type
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!