How do I delete the weird flat line?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
PromoCodeBSJ
am 2 Okt. 2018
Kommentiert: Walter Roberson
am 3 Okt. 2018
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196827/image.jpeg)
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
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 2 Okt. 2018
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 Kommentar
Walter Roberson
am 3 Okt. 2018
Perhaps the instruction should be
Slope = PeakPower ./ Current;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Directed Graphs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!