Code covered by the BSD License
function [x,g]=gvec(x,g); %***BEGIN PROLOGUE GVEC %***PURPOSE Subsidiary to %***LIBRARY SLATEC %***AUTHOR (UNKNOWN) %***ROUTINES CALLED (NONE) %***REVISION HISTORY (YYMMDD) % ?????? DATE WRITTEN % 891214 Prologue converted to Version 4.0 format. (BAB) %***end PROLOGUE GVEC g_shape=size(g);g=reshape(g,1,[]); %***FIRST EXECUTABLE STATEMENT GVEC g(1) = 0.0; g(2) = 1.0 + cos(x); g_shape=zeros(g_shape);g_shape(:)=g(1:numel(g_shape));g=g_shape; end %DECK H12
Contact us at files@mathworks.com