Change in the matlab table array

3 ビュー (過去 30 日間)
Sheraz Khan
Sheraz Khan 2018 年 10 月 18 日
回答済み: Image Analyst 2018 年 10 月 22 日
hi, i have a sensor having time, acceleration in x, y, z direction. i have imported the data using import command as a column vector. now i want to subtract a certain value from the time vector column so that it starts from zero. i used a stupid method but by using that and runningthe script 3 or 4 times the value in the vector changes to row or some other values. What is the right way to do so?
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 10 月 18 日
readtable() would probably be better suited.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 10 月 22 日
Not sure what you're doing since you didn't show your stupid (as you called it, not me) code. I'd use importdata() or csvread() or something like that to get the data in, then to extract the time and have it start from 0, you can do this:
t = data(:, 1); % Assumes time is in column 1.
% Have the min time be redefined as "0".
t = t - min(t);

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by