How do i step from a bigger number to a smaller number ?
Show older comments
I want to create an array with two numbers like this;
Xprime = x1 : 0.01 : x2
but when i make x1 > x2 i get an empty array.
Is there a solution to this ?
Accepted Answer
More Answers (2)
Akshit Bagde
on 30 Jun 2021
If you want to create a decrement array, you should use
Xprime = x1:-0.01:x2;
x = 2:-0.01:1
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!