How to write a continuosly extending matrix ( sample1=[3 2 3 4 1 2;sample] ) to an excel sheet cell by cell?
9 ビュー (過去 30 日間)
古いコメントを表示
The incoming data from serial connection writes the values in the sample matrix (sample values) changing each second, as:
semval = []
semval = [semval; sample1, sample2, sample3, sample4, sample5, sample6, sample7, sample8];
i want to export this data continuously to an excel sheet with each matrix element in different cells in the excel, i tried dlmwrite and csvwrite commands, but they output all line in just one cell. Outputing cell by cell is possible?
0 件のコメント
回答 (4 件)
Image Analyst
2012 年 2 月 11 日
Your first line initializing semval to null is unnecessary. This code works fine.
sample1 = 100;
sample2 = 200;
sample3 = 300;
sample4 = 400;
sample5 = 500;
sample6 = 600;
sample7 = 700;
sample8 = 800;
semval = [sample1, sample2, sample3, sample4, sample5, sample6, sample7, sample8]
csvwrite('test.csv', semval);
Each number is in one cell of Excel. I'm not sure what you did to mess it up. Alternatively, did you try xlswrite()?
If you want to write one cell at a time, like in a for loop, then you'll have to use ActiveX, because csvwrite, dlmwrite, and xlswrite all just write out the entire set of data in one batch operation, not cell by cell. See my posts here in Answers where I gave ActiveX demo code.
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!