Info

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

How to plot 5 rows from a dataset? My dataset size is 125*694. I have to plot 5 rows from there so total 5*694(3470) data point.. Whenever i have plotted this each row placed above of another row. X axis range should be 0-3500 but it shown 0-700

1 次查看(过去 30 天)
a = dlmread('EtLAPV_TextData_Class8.txt');
[m n]=size(a);
i=(a(1,:));
plot (i)
hold on
j=(a(2,:));
plot (j)
hold on
k=(a(3,:));
plot(k)
hold on
l=(a(4,:));
plot(l)
hold on
m=(a(5,:));
plot(m)
hold on
title('Electrode Response')
xlabel('Measurement points');
ylabel('Response');
I think there will be some sort of editing by which i can plot these rows only vertically !! Thanks in advance

回答(1 个)

Jacky Jo
Jacky Jo 2016-3-31
try the following:
a= randn(125,694); % change the randn(125,694)) by dlmread('EtLAPV_TextData_Class8.txt')
new_a=a(1:5,:); % took only first five rows.
new_a=new_a'; % interchange the row with col.
new_a=new_a(:) % make it a col. matrix/ vecor.
plot(new_a)
title('Electrode Response')
xlabel('Measurement points');
ylabel('Response');

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by