How to write a basic loop
Show older comments
[EDIT: Thu May 26 02:39:10 UTC 2011 - Reformat - MKF]
z = 0.05;
y = 1/20;
f = @(x) (10.^(-15).*x.^(3).*exp((x.^2).^(-1)/4).*y.^(-1)).^(1/5)-z;
fzero(f,1);
This is my given command line and I need to write a loop in order to solve for a range of z and y values? How would I go about this? I have tried just giving a y value such as:
for z = 0.05:.06,
f = @(x) (10.^(-15).*x.^(3).*exp((x.^2).^(-1)/4).*.05.^(-1)).^(1/5)-z;
fzero(f,1)
and letting it try and run a simple loop for z but it doesn't seem to work. It seems easy but its giving me a lot of trouble. Thanks ahead of time for any help.
Accepted Answer
More Answers (0)
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!