Create a matrix from a csv
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello, I have a csv file with a structure like this (or just take a look at the csv):
- name11,name21,name31
- number,number,number
- number,number,number
- ...
- name21,name22,name23
- number,number,number
- number,number,number
- ...
- name31,name32,name33
- number,number,number
- ...L ist the length of the space between two names, N is the number of matrixes.I want to save every number between two names as a separate matrix, the best would be a Lx3xN.How can I do that?
댓글 수: 4
Jan
2018년 11월 6일
There are some blank lines in addition.
How do you want to treat the date?
5 Nov 2018 11:00:00.000,6110.403876,-1714.451633,2349.558833
This does not match the pattern "number,number,number" exactly.
답변 (1개)
madhan ravi
2018년 11월 6일
편집: madhan ravi
2018년 11월 6일
Try
readtable()
T=readtable('Testfile_1.csv');
T(:,end-2:end) %reads last three columns
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!