How to write a basic loop
显示 更早的评论
[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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!