Hello,
I am trying to add time to my existing table. I have tried different methods but I am just getting started with MatLab and can't seem to figure this one out.
Where N = samples = 250.000 and ST = SampleTime = 3 and TS = Timestep = ST/N.
So I want it to add to my 6th column which I have already declared and where row 1 = 0, row 2 = 0 + TS, etc.. until I reach row 250.000 = ST.
Code I wrote for this part:
%add column6 and time to T1
T1.time = rand(250000,1);ST = 3; %declare SampleTime
N = 250000; %SampleSize
TS = ST/N; %calc TimeStep
i = 0;while i < N T1(i,6) = 0 + i.*TS; i = i + 1;end
This would give me the error:
"Right hand side of an assignment into a table must be another table or a cell array."
I suppose it has something to do with declaration of which column the data should be placed but I have no idea how I could fix this.
Best Answer