My code pulls some data out of binary files and puts this data into an Array. When the code is done running I can see this Array in the Workspace window. However, When I turn my code into a function, once executed, I can not see the resulting Array int the Workspace.
function getchan(wd)files = dir('*.bin');DATA=[];tic;for i=1:100 %length(files)
[d] = readbin (files(i).name); data=(d(:,1)); DATA=[DATA;data]endtoc;end
I also would like to be able to call this function and provide the directory to execute on as in getchan('directory') however, with code as is now, I have to make that directory the current directory first and then run the function by typing getchan
Best Answer