How to apply several .csv files to matlab one plot

12 ビュー (過去 30 日間)
Azar Guliyev
Azar Guliyev 2016 年 7 月 13 日
コメント済み: Walter Roberson 2016 年 7 月 14 日
Hello guys,
I want to apply 30 .cvs files into one matlab plot. I am attaching the original code which I am using to read only one file.
filename = 'jan1.csv';
elapsedTime = xlsread(filename, 'F:F');
elapsedTime = elapsedTime - elapsedTime(1);
deltaX = xlsread(filename, 'C:C');
deltaXmean = mean(deltaX);
deltaX = deltaX - deltaXmean;
deltaY = xlsread(filename, 'D:D');
deltaYmean = mean(deltaY);
deltaY = deltaY - deltaYmean;
deltaZ = xlsread(filename, 'E:E');
deltaZmean = mean(deltaZ);
deltaZ = deltaZ - deltaZmean;
So, i have about 30 .csv files named as "jan1" "jan2" etc. What I want to do is data from all of the files to be shown in the one plot. The file type is the same, means that the columns are in the same order for all the files.
Thanks a lot!

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 7 月 13 日
  6 件のコメント
Azar Guliyev
Azar Guliyev 2016 年 7 月 14 日
編集済み: Azar Guliyev 2016 年 7 月 14 日
Oh, apologize for the misunderstanding. I need all the data 3 plots to be shown only within all 30 files. I mean, for example, the column "C:C" in deltaX should contain 30 "C:C" columns altogether in one plot. In total I need 3 plots, deltaX, Y and Z to be plotted against elapsedTime and that's it, if you can help me with that. Thanks for your help.
Regarding the file, yes I downloaded it but the case is that I am just getting into Matlab and it is a bit hard for me to understand what to do.. :)
Thanks !
Walter Roberson
Walter Roberson 2016 年 7 月 14 日
Download the .zip into a handy directory that is not under the MATLAB installation directories. Unzip it, which will create a directory there. Now go into MATLAB and use the pathtool command to add that directory to the MATLAB path and save the path. You will now be able to use the routine.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by