Matlad read csv file and euclidean distance

I have a csv file with a lot of data The csv file looks like this
12001,0.2,0.32,0.9,....
12002,0.22,0.3,0.5,...
...
I need all this data in a matrix to compute the euclidean distance
to read the csv file I am using dlmread I need the data in a Matrix without the first value of each line, my matrix should look like this
M=[0.2 0.32 0.9; 0.22 0.3 0.5]
How can I skip the first value in each line and get my data into a matrix?

 Respuesta aceptada

Thorsten
Thorsten el 5 de Nov. de 2015
X = csvread('yourfile.csv');
X(:,1) = []; % delete first column

Más respuestas (1)

Jan
Jan el 5 de Nov. de 2015
M = csvread(filename);
M2 = M(:, 2:end);
D = sqrt(sum(M2 .* M2, 2));

Categorías

Etiquetas

Preguntada:

el 5 de Nov. de 2015

Respondida:

Jan
el 5 de Nov. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by