MATLAB Answers

Excel Columns to Matlab Array

62 ビュー (過去 30 日間)
Sarah Shi
Sarah Shi 2019 年 7 月 8 日
回答済み: Star Strider 2019 年 7 月 8 日
Hi! I am currently working on a 701x20 matrix of collected data and am trying to convert each column of data to a MATLAB array with a for loop. I am trying to avoid typing out something like this:
time = euh2(:, 1)';
li7 = euh2(:, 2)';
mg25 = euh2(:, 3)';
mg26 = euh2(:, 4)';
My data (named euh2) look like this:Screen Shot 2019-07-08 at 14.13.39.png
I've tried something these lines and am not having much success.
columns = zeros(1, length(euh2));
for ii = 1:20
columns(ii) = euh2(:, ii);
end
Any help would be greatly appreciated! Thank you!

  0 件のコメント

サインイン to comment.

回答 (2 件)

Tatvam Dadheech
Tatvam Dadheech 2019 年 7 月 8 日

  0 件のコメント

サインイン to comment.


Star Strider
Star Strider 2019 年 7 月 8 日
I would use the readtable function if your have R2013b or later.
You can probably then convert it into a timetable array (R2016b or later) if the ‘Time’ values are imortant and you can parse them into something useful that datetime (R2014b or later) can interpret. It is not currently obvious what their units are, or how to interpret them.

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。


Translated by