How do I assign multiple values to variable?

2 views (last 30 days)
I have to use ODE45 to solve the following equation
IC's y(0)=0, dy(0)/dx = 3 b = 0.1,1,10,100,1000
I think I have a handle on how to do use the ODE45 function but I am having problem with the values of b. How do I set b equal to the list of values? Thanks.

Answers (1)

Steven Lord
Steven Lord on 9 Nov 2015
See the ODE45 documentation; the Description section includes a link describing how to parameterize the function you pass into ODE45. You will not be able to solve your system for all of your values at once, but you can solve the system with multiple calls to ODE45 (in a loop, for example), one call per value of b.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!