How do I delete the weird flat line?

조회 수: 2 (최근 30일)
PromoCodeBSJ
PromoCodeBSJ 2018년 10월 2일
댓글: Walter Roberson 2018년 10월 3일
How do I delete the flat green line that appears? It seems to just pop in for no reason.
Current= xlsread(path,sheet,['B2:B' num2str(unique+1)]);
PeakPower= xlsread(path,sheet,['E2:E' num2str(unique+1)]);
Slope=PeakPower/Current;
figure(SlopevsA)
plot(Current,Slope)
hold on
That is my code

채택된 답변

Adam Danz
Adam Danz 2018년 10월 2일
If your variables Current and PeakPower are column vectors (which appears to be the case), when you divide them
Slope=PeakPower/Current;
the output, Slope is a matrix and at least one column of that matrix are zeros which produces the straight line at y=0.
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 10월 3일
Perhaps the instruction should be
Slope = PeakPower ./ Current;

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

추가 답변 (0개)

카테고리

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