stairs function not working

stairs function not working. Empty figure. Any idea

8 件のコメント

Adam
Adam 2017 年 11 月 8 日
Since you posted no code then no! The stairs function works fine if you give it the right inputs and have your axes setup appropriately.
Jameel Qadri
Jameel Qadri 2017 年 11 月 8 日
編集済み: dpb 2017 年 11 月 8 日
Thanks Adam. It does not work with the simple code and i tried this simple example directly copied from Matlab. although it does work when i run it in browser. so dont know what could be the problem.
X = linspace(0,4*pi,40);
Y = sin(X);
figure
stairs(Y)
Adam
Adam 2017 年 11 月 8 日
Works fine for me so long as I add a ';' after 'figure'.
KSSV
KSSV 2017 年 11 月 8 日
What does which stairs give?
Jameel Qadri
Jameel Qadri 2017 年 11 月 8 日
Thanks KSSV. it gives empty figure no display of the graph.
Jameel Qadri
Jameel Qadri 2017 年 11 月 8 日
Tried ; nothing showing up.
dpb
dpb 2017 年 11 月 8 日
which stairs
is a command at the command line to prove you've got the correct stairs m-file in the path being executed, not a question about what you were seeing. What response did you get; it should be something like
>> which stairs
C:\ML_R2014b\toolbox\matlab\specgraph\stairs.m
>>
with a specific path/version system-dependent, of course.
You can also try
clear stairs
and then try the example again to just clear any inadvertent variable you may have aliased the function with which is the solution to the which command showing you have done something of the sort.
Jameel Qadri
Jameel Qadri 2017 年 11 月 8 日
Thanks dpb. The mistake i had done was i had given the file name as stairs.m. I changed it, now it works.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series Events についてさらに検索

タグ

質問済み:

2017 年 11 月 8 日

コメント済み:

2017 年 11 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by