importing data from .csv files of different lengths and same columns in matlab and getting RMS.
I have a displacement data in 73 .csv files which are comma separated with 7 (fixed) columns and rows (varying) from 1500 to 9000 rows depending on the file. Each file contains 7 Columns as x y z(coordinates of voxels) and u v w(displacements in u v w directions) and sigma in 7th column. I want to create a code to read the .csv files and get the rms error in u v w directions respectively. RMS formula has to applied and i have to get 1 rms value for all the files combined and that too it should consider all the values of u v w in all the files.Can someone help me with the idea.I have attached the code which i used which i not working. I attached some files of the format .csv in the attachments.
data0001 = csvread(‘C://Users//User//Desktop//.csv//data_0001.csv’);
.
.
.
.
.
data0071 = csvread(‘C://Users//User//Desktop//.csv//data_0071.csv’);
data0072 = csvread(‘C://Users//User//Desktop//.csv//data_0072.csv’);
data0073 = csvread(‘C://Users//User//Desktop//.csv//data_0073.csv’);
%Root Mean Squared Error
for ii= 01:01:73
erroru{ii} = (sum((data00ii(:,4)).^2)); %error in u
errorv{ii} = (sum((data00ii(:,5)).^2)); %error in v
errorw{ii} = (sum((data00ii(:,6)).^2)); %error in w
U=erroru{ii}/(length(data00ii));
V=errorv{ii}/(length(data00ii));
W=errorw{ii}/(length(data00ii));
S= sum(U+V+W);
rmsError{ii} = sqrt(S);
show(rmsError{ii})
endI have a displacement data in 73 .csv files which are comma separated with 7 (fixed) columns and rows (varying) from 1500 to 9000 rows depending on the file. Each file contains 7 Columns as x y z(coordinates of voxels) and u v w(displacements in u v w directions) and sigma in 7th column. I want to create a code to read the .csv files and get the rms error in u v w directions respectively. RMS formula has to applied and i have to get 1 rms value for all the files combined and that too it should consider all the values of u v w in all the files.Can someone help me with the idea.I have attached the code which i used which i not working. I attached some files of the format .csv in the attachments.
data0001 = csvread(‘C://Users//User//Desktop//.csv//data_0001.csv’);
.
.
.
.
.
data0071 = csvread(‘C://Users//User//Desktop//.csv//data_0071.csv’);
data0072 = csvread(‘C://Users//User//Desktop//.csv//data_0072.csv’);
data0073 = csvread(‘C://Users//User//Desktop//.csv//data_0073.csv’);
%Root Mean Squared Error
for ii= 01:01:73
erroru{ii} = (sum((data00ii(:,4)).^2)); %error in u
errorv{ii} = (sum((data00ii(:,5)).^2)); %error in v
errorw{ii} = (sum((data00ii(:,6)).^2)); %error in w
U=erroru{ii}/(length(data00ii));
V=errorv{ii}/(length(data00ii));
W=errorw{ii}/(length(data00ii));
S= sum(U+V+W);
rmsError{ii} = sqrt(S);
show(rmsError{ii})
end I have a displacement data in 73 .csv files which are comma separated with 7 (fixed) columns and rows (varying) from 1500 to 9000 rows depending on the file. Each file contains 7 Columns as x y z(coordinates of voxels) and u v w(displacements in u v w directions) and sigma in 7th column. I want to create a code to read the .csv files and get the rms error in u v w directions respectively. RMS formula has to applied and i have to get 1 rms value for all the files combined and that too it should consider all the values of u v w in all the files.Can someone help me with the idea.I have attached the code which i used which i not working. I attached some files of the format .csv in the attachments.
data0001 = csvread(‘C://Users//User//Desktop//.csv//data_0001.csv’);
.
.
.
.
.
data0071 = csvread(‘C://Users//User//Desktop//.csv//data_0071.csv’);
data0072 = csvread(‘C://Users//User//Desktop//.csv//data_0072.csv’);
data0073 = csvread(‘C://Users//User//Desktop//.csv//data_0073.csv’);
%Root Mean Squared Error
for ii= 01:01:73
erroru{ii} = (sum((data00ii(:,4)).^2)); %error in u
errorv{ii} = (sum((data00ii(:,5)).^2)); %error in v
errorw{ii} = (sum((data00ii(:,6)).^2)); %error in w
U=erroru{ii}/(length(data00ii));
V=errorv{ii}/(length(data00ii));
W=errorw{ii}/(length(data00ii));
S= sum(U+V+W);
rmsError{ii} = sqrt(S);
show(rmsError{ii})
end rms, csv MATLAB Answers — New Questions