Operating on CSV file as a matrix
61 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Enrico Danzi
il 16 Mar 2021
Commentato: Enrico Danzi
il 16 Mar 2021
Dear all.
I'm a low to medium level user of Matlab (mainly for analysing data and plotting, not strong in coding),
I have a trivial question, maybe it's easy fro you, but I'm stucked.
I've imported my CSV file as a numeric matrix (1064X561), I'd like to extract some data from it and plot them (firstly the mean of all rows, columns and the max of all rows and columns).
The basic commands I'm using (S is the matrix):
M = mean(S);
M2 = mean(S,2);
Max = max(S);
Max2 = max(S,2);
I've imported the data with semicolon delimiters, I know there's some issues in the values (a factor of 100, maybe different numeric format?),
but the big deal is I did get the two mean and the max for columns, but when I'm checking the row max is a 1064X561 matrix, while
it has to be a 1X561.
What did I do wrong? Is there an easy way to get this?
Any help is appreciated,
Thanks a lot
0 Commenti
Risposta accettata
Walter Roberson
il 16 Mar 2021
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/552082/Starch%20300g%203.5bar%20coarse_20201209_163713_20201209_163915_DF+20_Intensitychart.xls.csv';
S = readmatrix(filename, 'Delimiter', ';', 'DecimalSeparator', ',');
size(S)
M = mean(S);
size(M)
M2 = mean(S,2);
size(M2)
Max = max(S);
size(Max)
Max2 = max(S,[],2);
size(Max2)
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!