Info

此问题已关闭。 请重新打开它进行编辑或回答。

how can I import my data from a text file containing different columns with text characters at the first line and then plot them ?

2 次查看(过去 30 天)
Hi All,
I have large text file which its content is as follows:
A B C D E ...
12.3 14.43 15.67 17.56 23.95 ...
.
.
.
this file has 82 columns and something about 10000 lines, And I am going import these data using a script into an array or something, and then plot them (for example B Vs. C). Actually, I think there should be a way to do this, but I don't know how. So, it's so appreceiated if someone could help with this.
thanks.

回答(1 个)

KSSV
KSSV 2020-6-14
data = importdata(mytextfile) ;
B = data(:,2) ;
C = data(:,3) ;
plot(B,C)
Also read about readtable, load, textscan.

Community Treasure Hunt

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

Start Hunting!

Translated by