Browse CSV file and calculate the mean
28 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I am on the end on my projet. I need to browse a csv file and to calculate the mean of these values. Then i will put this mean in a new csv file
Does anyone have suggestion or programme for help ?
Thanks
0 个评论
回答(1 个)
Ameer Hamza
2020-9-21
1) Read the csv file using: readmatrix(): https://www.mathworks.com/help/matlab/ref/readmatrix.html, or readtable(): https://www.mathworks.com/help/matlab/ref/readtable.html.
2) Calculate the mean values of the data according to its dimensions.
3) Write the data to file using writematrix(): https://www.mathworks.com/help/matlab/ref/writematrix.html or writetable(): https://www.mathworks.com/help/matlab/ref/writetable.html
4 个评论
Ameer Hamza
2020-9-22
编辑:Ameer Hamza
2020-9-22
yes, you can specify the range too. For example,
range = input('Input the range: ', 's'); % input A1:A20
data = readmatrix('filename.csv', 'range', range)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!