matlab - Apply a function iteratively to pieces of arrays -
so have cute pretty function requires 2 input: price vector , date vector:
function [tsve, timeint, dbin,adjtsve, stringdate,rvavg,rv ] = tsve( price,datetime ) now have vectors price , datetime covering long period let 20days , want compute previous function on each day. number of observations each day random can manage find last observation of day.
date=floor(datetime); [a, b, c]=unique(date,'legacy'); <----this gives me index last obs of day [~, nbin]=histc(date,a,1); <----i thinking accumarray made this, not sure can use on 2 values simultaneously so thinking, there way run function (iteratively) on each piece of 2 vectors? or should split 2 vectors pieces , run function on each piece?
thank in advance
Comments
Post a Comment