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

14 vues (au cours des 30 derniers jours)
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

Réponses (1)

Walter Roberson
Walter Roberson le 6 Avr 2018

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by