trying to create a variable less than or equal to pi/2 but more than -pi/2
2 views (last 30 days)
Show older comments
Hey, I'm sure I must be missing something completely obvious, but I have been trying to create the variable x which is a certain range, -pi/2 >= x pi/2 I've tried things such as x = (= -1.5708) & (<= 1.5708) x = -1.5708:0.1:1.5708 Not sure how to best approach this. Many thanks.
0 Comments
Accepted Answer
Dr. Seis
on 9 Oct 2011
You can create a dx, such as:
dx = pi/100;
Then define x as:
x = -pi/2 : dx : pi/2-dx;
2 Comments
Dr. Seis
on 9 Oct 2011
It isn't necessary to create the "dx" variable. It is equally valid to also do:
x = -pi/2 : pi/100 : pi/2 - pi/100;
I like to create the "dx" variable because if I want to make it smaller or larger, then I need only change it once.
More Answers (1)
Walter Roberson
on 9 Oct 2011
You asked about this before and did not respond to requests for clarification. Please delete this question and go back to your previous question and clarify there.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!