How do i use fzero to solve the following
4 views (last 30 days)
Show older comments
Liam Wiltshire
on 9 Jan 2018
Commented: Liam Wiltshire
on 9 Jan 2018
My code reads as follows:
time2 = [0:1:4000];
y = log10(62) - log10(49) - 0.000084*time2;
fzero(y,1200)
I need to use fzero to calculate the value of time2 when the above equasion is zero. I don't know why it wont work as above but despite my best efforts nothing will stick.
Cheers
p.s. i need to use fzero so alternative solutions, whilst welcome, won't solve my problem.
0 Comments
Accepted Answer
Stephen23
on 9 Jan 2018
Edited: Stephen23
on 9 Jan 2018
That is not how to use fzero. As its help clearly states and shows, the first argument must be a function handle, which you have not provided. Try this:
>> fun = @(t) log10(62) - log10(49) - 0.00008*t;
>> fzero(fun,1200)
ans = 1277.4
and reading the MATLAB documentation.
3 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!