How to log(append) the data to excel sheet continously when using 'while' loop?
17 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!