Rewrite CSV First Column

1 次查看(过去 30 天)
Thuan
Thuan 2020-7-15
评论: Thuan 2020-7-16
Hi I was hoping someone can help me with my code, I'm new to matlab
data=csvread('TP4765.csv')% Import data
N=size(data,1);% determine number of increment
m=0.001;
%%%%%%%%%%%%%%%%%
the csv is 2052766x7 matrix
I would like like to replace the first colum with a vector starting from 0 in increment "m" for N times(increase 0.001 increment 2052766 times)
Thanks
Thuan

采纳的回答

madhan ravi
madhan ravi 2020-7-15
编辑:madhan ravi 2020-7-15
m = 0.001;
N = 2052766;
data(:,1) = 0 : m : N*m - m;
dlmwrite('TP4765.csv',data)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by