Export Data to excel
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a lot of .csv files to analyse and have opted to use matlab instead of excel to perfrom the analysis, however, I would like the results from this analysis to be stored in an excel file. I have created a matlab file for each .csv file and want the results from each script to be exported to excel. I opted to operate this way so I did not have to use dynamically assigned variable names.
Could you please help with code that I could add to my script which will add my results to a new row in an excel spreadsheet?
Thank you in advance.
Max
댓글 수: 3
Bob Thompson
2021년 2월 25일
You can export to a specific range with xlswrite, but I don't know an easy way to determine what the next empty row within a file is. The options that I know of are the following:
1) You can detect whether a cell in excel is filled while the file is open in the actxserver, but then you might as well just do this project in VBA.
2) You can read the existing data in the file into a variable, determine the length, and generate a range based on that value, but then you might as well do what I suggested before.
3) If you are performing the operation on all of the csv files in one script you can keep a counter and generate the appropriate excel range based on that counter. This is certainly a functional option, but you would be better off keeping all of your data from your csvs in one array, and just printing once.
There may be a way to look for empty cells that I don't know about, but I can't tell you what it is, because I don't know about it.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!