does PHP have a function like matlab's linspace? -
i want execute following code in php
linspace(1,7,4);
i want have linear array list output.
function linspace($i,$f,$n){ $step = ($f-$i)/($n-1); return range ($i,$f,$step); } $test = linspace(0,3.14159,8); print_r($test);
i have written own in minutes. please test out.
Comments
Post a Comment