inputting an output file name into a function
Show older comments
HI,
I have a function:
function=tcaproc(mults,c2flag,filename)
where I do some math and then want to print to a file called filename.txt, for example, something like data1out.txt. I want to be able to change the filename is my point. So far I have tasted only abject failure.
formatSpec='%s.txt';
str=sprintf(formatSpec,filename)
file=fopen(str,'wt+');
just tells me that my filename doesn't exist.
test=tcaproc(as4,1,test1);
Undefined function or variable 'test1'.
I would appreciate your help.
Accepted Answer
More Answers (1)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!