Write/Read CSV file
21 views (last 30 days)
I'm trying to write table into a CSV file that looks like the following:
Row 1 will be kept the same, then the other rows will be added to the file while the script is running (or added at once at the end).
I tried using writetable, csvwrite, etc... but it does not come out to what I want, and I am having trouble creating a matrix with text.
Please help. Thanks.
Chirag Nighut on 2 Jul 2019
To create a matrix with text you can create a 2D array of chars. To do that you can use the following code:
data = ['MATLAB ';'SIMULINK ';'POLYSPACE'];
celldata = cellstr(data)
chr = char(celldata)
Although before using char you should check if celldata is cell array of character vetors. Following function can help you
I request you to post the exact error/difficulty that you got using csvwrite and writetable. I can then try to help you get the desired results.