필터 지우기
필터 지우기

excel and plot

조회 수: 3 (최근 30일)
Ean Soo
Ean Soo 2011년 3월 6일
Hie guys, i have an excel file which have 2 column with 1600 rows. I use this command to read both entire row.
fileName= 'data.xls';
a=xlsread(fileName);
x=a(:,1);
y=a(:,2);
plot(x,y)
Is it possible for me to just read the data for column x from 1 to 200? Is it possible to add another plot of straight line which is x=100 in the same plot?if yes, how to implement that? thank you. Regard EAN

답변 (1개)

Paulo Silva
Paulo Silva 2011년 3월 6일
x(1:200) %all data from column 1 to 200
hold on %this will allow more lines on the same axes
The last question I don't know exactly what you want
line([100 100],get(gca,'Ylim')) %vertical line x=100
line(get(gca,'Xlim'),[x(100) x(100)]) %horizontal line x(100)
  댓글 수: 1
Ean Soo
Ean Soo 2011년 3월 7일
For the last part, i would like to plot a vertical line.For example
the range of y is 0 to 0.02
and x is 100.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by