How to include string + numbers in a table using a for...end routine
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(3 个)
Jeremy
2019-12-4
It sounds like you might want to use the command
readtable
This will read your entire spreadsheet as a table data type
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!