problem with stairs plot

조회 수: 12 (최근 30일)
deborah
deborah 2011년 8월 20일
Hello I have just delighted come across 'stairs', which does exactly what I want...except it doesn't.
Even the example given: >> x = linspace(-2*pi,2*pi,40); >> stairs(x,sin(x))
plots me a single straight line between (0,0) and (1,1). (Everything I try gives this plot result)
Any great ideas for the obvious thing I'm doing wrong very gratefully received!
yours, Flummoxed.

답변 (3개)

Daniel Shub
Daniel Shub 2011년 8월 20일
Is something overloading stairs? Try
which -all stairs
it should give something like: .../toolbox/matlab/specgraph/stairs.m
  댓글 수: 2
deborah
deborah 2011년 8월 20일
thanks for your reply.
unfortunately it doesn't seem to be the fix (though, good thought!)....
indeed it says: C:\Program Files\MATLAB\R2007b\toolbox\matlab\specgraph\stairs.m
Fangjun Jiang
Fangjun Jiang 2011년 8월 20일
What do you see if you do:
x = linspace(-2*pi,2*pi,40);
figure;plot(x,sin(x))

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


Fangjun Jiang
Fangjun Jiang 2011년 8월 20일
What's wrong? try stairs(1:20,1:20)
  댓글 수: 4
Fangjun Jiang
Fangjun Jiang 2011년 8월 20일
try this.
close all
stairs(1:20,1:20);
deborah
deborah 2011년 8월 20일
same result! :(

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


deborah
deborah 2011년 8월 21일
I have no idea, but now after 3 reboots it suddenly works. That'll be fixed then..... thanks for people's suggestions.

카테고리

Help CenterFile Exchange에서 Labels and Styling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by