interp1 stop-end condition

3 views (last 30 days)
Vittoria D'Avino
Vittoria D'Avino on 25 Nov 2014
Edited: Star Strider on 25 Nov 2014
Hi,
I would like to put a condition on the interp1 function. The following function Vx in inserted in another function in which there is a for cycle of n data and for each of them x has a maximum value. The maximum of column stor(:, 1) varies for each i, so if it reaches the maximum of stor(:,1) I should write zero. Instead the interpolation continue also outside the interval...
volx = Vx(ddbsi, x, organ, std_dose)
stor = choose(organ, ddbsi, std_dose);
md = max(stor(:, 1));
[v, i] = union(1 - cumsum(stor(:, 2)), []);
volx = interp1([stor(i, 1); inf], [v; 0], x, 'linear', 1);
Can I resolve? Thanks a lot

Answers (0)

Categories

Find more on Mathematics 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!