how to use the data from .dat file for plotting graph
81 ビュー (過去 30 日間)
古いコメントを表示
I generated a data file in .dat form using a spice tool now I want to call this data file in matlab and use the x and y coordinates from the data file to plot the data in matlab .I am attaching the file having my data it is in txt format now as the attachments doesn't accept .dat format so anyone working with my file plz change the extension to .dat.
0 件のコメント
回答 (2 件)
Star Strider
2014 年 6 月 3 日
I do not know if this would work for ‘.dat’ files, but it works for the ‘.txt’ file you posted:
T = readtable('switch.txt', 'HeaderLines', 5, 'Delimiter','\t','ReadVariableNames',false);
Time = T.Var2;
iv1 = T.Var3;
figure(1)
plot(Time, iv1)
grid
7 件のコメント
Star Strider
2014 年 6 月 4 日
編集済み: Star Strider
2014 年 6 月 4 日
My pleasure!
(The sincerest form of appreciation here on MATLAB Answers is to Accept the Answer that most closely solves your problem.)
Daniel
2014 年 10 月 17 日
Hi guys, I have a similar problem. I saved some data in a .dat file. I can load the data to matlab and it saves it in an array but I don't know how to plot a graph using the data. Any help would be appreciated.
2 件のコメント
Star Strider
2014 年 11 月 17 日
@Siddharth Pande —
I very much appreciate your recommending my Answer. Now would your please Accept it?
参考
カテゴリ
Help Center および File Exchange で Data Import and Export についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!