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 件のコメント
KSSV
KSSV 2018 年 5 月 24 日
YOu make your cell ready....and write all data at a time..
Abhijit Bari
Abhijit Bari 2018 年 5 月 24 日
I am writing continuously but after a data in a row is filled , i want it to go to the next row in the sheet, and i don't know how to do that.

サインインしてコメントする。

採用された回答

ES
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 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by