ASK Demodulation code here it is............
function run(script)
cur = cd;
if isempty(script), return, end
if ispc, script(script=='/')='\'; end
[p,s,ext] = fileparts(script);
if ~isempty(p),
if exist(p,'dir'),
cd(p)
w = which(s);
if ~isempty(w),
% Check to make sure everything matches
[wp,ws,wext] = fileparts(w);
% Allow users to choose the .m file and run a .p
if strcmp(wext,'.p') && strcmp(ext,'.m'),
wext = '.m';
end
if ispc
cont = ~strcmpi(wp,pwd) | ~strcmpi(ws,s) | ...
(~isempty(ext) & ~strcmpi(wext,ext));
else
cont = ~isequal(wp,pwd) | ~isequal(ws,s) | ...
(~isempty(ext) & ~isequal(wext,ext));
end
if cont
if exist([s ext],'file')
cd(cur)
rehash;
error(message('MATLAB:run:CannotExecute', [ s, ext ]));
else
cd(cur)
rehash;
error('MATLAB:run:FileNotFound','Can''t find %s.',[s ext]);
end
end
try
evalin('caller', [s ';']);
catch e
cd(cur);
rethrow(e);
end
else
cd(cur)
rehash;
error('MATLAB:run:FileNotFound','%s not found.',script)
end
cd(cur)
rehash;
else
error('MATLAB:run:FileNotFound','%s not found.',script)
end
else
if exist(script,'file')
evalin('caller',[script ';']);
else
error('MATLAB:run:FileNotFound','%s not found.',script)
end
end
Are you sure? This action cannot be undone.