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에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!