Executable
Executable
(OP)
I have a function that takes 4 input files which are in .txt format. I created an executable with the function and when I run it in dos prompt. I get an error
"ERROR can't open file ALoad.txt."
ALoad is one of my input files in the function. I deleted the file extensions and tried again but I get the same error. However when I run the function from matlab prompt I get good result. Could someone please tell me how I can resolve this problem. Thanks.
ahad
"ERROR can't open file ALoad.txt."
ALoad is one of my input files in the function. I deleted the file extensions and tried again but I get the same error. However when I run the function from matlab prompt I get good result. Could someone please tell me how I can resolve this problem. Thanks.
ahad





RE: Executable
RE: Executable
=====================================================
function [g] = afitfun(Aload,Delunz,Int,sc,FSLoad)
% Input files
load Aload.txt;
load Delunz.txt;
load Int.txt;
load sc.txt;
load FSLoad.txt;
for i=1:6
c(:,i)=Delunz(:,i)*sc(1,i);
end
c;
d=zeros(729,6); %
for m=1:100
e=zeros(729,6);
e=c-d;
f=zeros(729,6);
for i=1:9:729
for j=1:9
f(i+j-1,:)=e(i+j-1,:)-e(i,:);
end
end
f;
sizef=size(f);
save testf f -ascii -tabs
save teste e -ascii -tabs
p=1;
for i=1:6
for j=1:6
h(:,p)=e(:,i).*e(:,j);
p=p+1;
end
end
del=[7,13,14,19,20,21,25,26,27,28,31,32,33,34,35];
l=size(h);
h(:,del(1,:))=[];
h;
hi=[e h];
g=f-Aload;
g=100*g;
for i=1:6
g(:,i)=g(:,i)/FSLoad(1,i);
d=hi*Int;
end
save Error g -ascii -tabs
end
===================================================
RE: Executable
help load
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Executable
Your function declarator tells me that when you call the function, you are passing it the arguments in parentheses, yet the first thing you do in the function is try to load them with an incorrect load command syntax. Either you have the arguments loaded before you call the function to pass them to it, or you really don't need to pass it any arguments if you are going to load the files within the function.
xnuke
"Do you think you used enough dynamite there, Butch?"
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Executable
http://www.hackstadt.com/features/whale/
follow the links to the video and judge yourself !!! ; )
yes try:
help load
load -ascii filename
the ascii statement forces to see the file as ascii txt
RE: Executable
>> load Aload.txt
and so on for each file at the matlab prompt.
I think the function is unable to load the files using the input arguments alone in the function and hence DOS gives an error:
"Input argument 'Delunz' is undefned"
RE: Executable
help load
the syntax you are trying to use is not even mentioned.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Executable
You mean the syntax i used in the script or at the DOS prompt? The syntax I used is the same in both places but you are saying that it is not proper to use it either way right?
ahad
RE: Executable
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Executable
PATH: existingpath;C:\matlabr12\bin\win32
this is what i had set it to earlier. But i also tried
PATH: existingpath;C:\matlabr12\D1\D2
D1 D2 being the location where my input files and script are located. Alas DOS continunes to give me the same error.
RE: Executable
ahad
RE: Executable
http://w
M
--
Dr Michael F Platten