How to use two columns from a spreadsheet in differential equation

1 view (last 30 days)
I have a spreadsheet of data points taken at specific times. I would like to use the time points as tspan in my differential equations and use the data points as input into the dy(1). Essentially, I need to evaluate at each time point using the time paired data point as input into the first equation of my system. I've tried importing the data and times as two separate variables and then indicating tspan='TIME' which gave me the error message of "The entries in tspan must strictly increase or decrease" which they do all decrease. I haven't had any luck trying to figure out to input the paired data values into dy(1). Any advice would be appreciated!
RAB

Answers (1)

Walter Roberson
Walter Roberson on 1 Sep 2015
tspan='TIME' would try to use the row vector of characters 'T' 'I' 'M' 'E' . As numeric values, that is 84 73 77 69 which is not strictly increasing and is not decreasing. You need to pass the data as the tspan, not the name of the variable.
tspan = TIME;

Community Treasure Hunt

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

Start Hunting!