How to run a while loop for each element in a row matrix?
4 views (last 30 days)
Show older comments
With my very basic understanding of matlab scripts, I wrote the following one to perform an iterative calculation to find x:
inv_alpha = .32
x = 0
while y < round (inv_alpha, 4)
x = x+.01
y =(round (tand (x) - deg2rad (x), 4))
end
disp (x)
disp (y)
This ran quite exactly as I expected. But now I want to run this for an array of the variable "inv_alpha", for example:
inv_alpha = linspace (0, 0.3, 10)
Therefore I expect to see 10 output values for "y". Can someone pl. help what changes I should do to the script?
0 Comments
Accepted Answer
More Answers (0)
See Also
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!