i am trying to enter data into an excel spreadsheet through matlab by prompting the user to enter string . The next data doesn't go to the next row in the spreadsheet
조회 수: 1 (최근 30일)
이전 댓글 표시
for a = 1:(desired_number)
det_1=[]
con_1=[]
disease_1=[]
det = 'Enter the details for patient ';
det_1 = input(det,'s')
con = 'Enter his Condition'
con_1 = input(con,'s')
disease = 'enter his diseases'
disease_1=input(disease,'s')
%disp(det_1)
%disp(con_1)
%disp(disease_1)
%t = table(det_1,con_1,disease_1)
patient = 'filename';
M = {'Patient_No ','Condition','Disease';det_1,con_1,disease_1};
sheet = 1;
xlrange = 'A:C';
xlswrite(patient,M,sheet,xlrange)
댓글 수: 2
채택된 답변
ES
2018년 5월 24일
Your xlrange should contain information regarding row number.
For example instead of
xlrange = 'A:C';
use
xlrange = ['A', num2str(a), ':C', num2str(a)];
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!