function [pfdataout] = formatpfdata(xin,zin,interpspace) % Written by Joshua Simmons 11/02/2015 - to format profile data as % required (linear interploation etc etc % Input: % xin = cross shore % zin = elevation % interppspace = regular spacing of the profile to be linearly % interpolated to. Leave as "NaN" if raw input points to % be used. % Output: % structure with .x,.z formatted as required. if isnan(interpspace) pfdataout.x = xin; pfdataout.z = zin; else minx = min(xin); maxx = max(xin); pfdataout.x = [minx:interpspace:maxx]; pfdataout.z = interp1(xin,zin,pfdataout.x); end end