Invalid filename using GUIDE

Hello Everyone,
I come here because I'm currently working on Matlab and more particularly with guide to create a GUI for my algorithm. Without the GUI implementation the algorithm was working well but since I implement it, there is still this error message :
??? Error using ==> saveas at 81 Invalid filename.
Error in ==> dataprocess at 64 saveas(gcf,outfilename1,'jpg')
I give you here some parts of my code:
the function which gives the problem:
MATLAB code
function [Datafinal]=dataprocess(filename1,filename2,filename3,filename4,filename5,rangedc,decalgain2,gaintest,backrem,filtr,r,average,outfilename1);
[Data]=ReadSegyFast(filename1);
[T1R1]=suppr(Data);
[Data2]=ReadSegyFast(filename2);
[matdeca]=decal(Data2);
[T2R1]=suppr(matdeca);
[Data3]=ReadSegyFast(filename3);
[matdeca2]=decalgros(Data3);
[T2R2]=suppr(matdeca2);
[Data4]=ReadSegyFast(filename4);
[matdeca3]=decal(Data4);
[T2R3]=suppr(matdeca3);
[Data5]=ReadSegyFast(filename5);
[T3R3]=suppr(Data5);
matadd=T1R1+T2R1+T2R2+T2R3+T3R3;
[matdcoff]=dcoff(matadd,rangedc);
if gaintest==1
[matgain]=gain(matdcoff,decalgain2);
else
matgain=matdcoff;
end
if average==1
[mattav]=rollaverage(matgain,r);
else
mattav=matgain;
end
if backrem==1
[Datafinal]=backremove(mattav,filtr);
else
Datafinal=mattav;
end
fig = figure;
set(fig,'Units','Normalized','Position',[0 0 1 1]);
colormap(gray);
imagesc(Datafinal)
colorbar
saveas(gcf,outfilename1,'jpg')
end
and here is the concerned part of what I put in the GUI *.m file:
MATLAB code
outfilename=get(handles.edit4,'String');
[Datafinal]=dataprocess(file1,file2,file3,file4,file5,rangedc,decalgaintest,gaintest,backrem,filtr,r,average,outfilename);
Anyone could help me ?
Thnaks a lot,
Lucas

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 25 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!