Generating A Step Like Function In MATLAB.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, Previous suggestion to my question was alright. That was much useful to generate a step like function using the command"stairs". But I need to do it without using the standard in-built functions. So, can anyone please help me in generating a stair like function using for loops(or something like that) whose increment and decrement should be by same amount and rises upto a certain height,in MATLAB.
Thanking You!
댓글 수: 0
채택된 답변
Titus Edelhofer
2012년 1월 6일
Hi,
in this case I would take a look at the output of stairs, e.g.
[x,y]=stairs(1:3, 2:0.5:3)
x =
1
2
2
3
3
y =
2.0000
2.0000
2.5000
2.5000
3.0000
and try to achieve the same using "pure" MATLAB code ...
Titus
댓글 수: 2
Titus Edelhofer
2012년 1월 6일
The slope is the ratio by how fast the y values grow devided by how fast the x values grow. If you plot the stairs above (e.g. call stairs without "[x,y]=", followed by "axis equal" you will see, that those stairs have a slope of 0.5 ...
Titus
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!