How to log(append) the data to excel sheet continously when using 'while' loop?

16 ビュー (過去 30 日間)
Prajwal Ramakrishna
Prajwal Ramakrishna 2018 年 4 月 6 日
編集済み: Prajwal Ramakrishna 2018 年 4 月 6 日
Hello! I am using MATLAB to read a real-time serial data. I am using a 'while' loop to iterate the loop continuously. Within the while loop I have a resultant matrix which stores the variables i require. Then I use 'xlswrite' command to store these values. But the problem is, for every iteration this file 'sampletest.xlsx' gets rewritten. I want the new values of every iteration to be stored in the same file i.e. they have to get appended below the previous set of values. How can I achieve this? Hoping to find some help.
while <condition>
.
.
.
filename = 'sampletest.xlsx';
D = [(vfl) (vfr) (vrl) (vrr) (temp) (tps) (delta) (time) (vv) (Ax) (s_rr) (s_rl)] %concatenated matrix
sheet = 1;
log_data = xlswrite(filename,D,sheet);
.
.
end

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 4 月 6 日

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by