Why a cell array of numeric data rather than a numeric array? Many questions are about removing loops. Why a while-loop?
This is more like the Matlab way:
N = 1000;
data = rand( N, 1 );
tmp = (data(1:end-2)+data(3:end))/2;
out = 100*abs( data(2:end-1) - tmp )./ tmp;
plot( out )
.
--- Another example ---
N = 100;
n = transpose( (1:N) );
data = sin( 2*pi*n/N );
before = [ nan; data( 1 : end-1 ) ];
after = [ data( 2 : end ); nan ];
plot( n, [ before, data, after ], '.' )
tmp = ( before + after ) / 2;
out = 100*abs( data - tmp )./ tmp; % eq is the name of a function
plot( n, data-tmp, '.' )
plot( n, out, '.' )
.
See "Evaluate Subsections of Files Using Code Cells" in the documentation and evaluate the cells one at a time.