I am trying to send a file by function. I have two functions. The contents are as follows :
power_subch=[1 1 1 1 1 1 1 1 1 1 ];
fid = fopen(sFileName,'wt');
gSNR=Gav(noise_vec, power_subch,aver_power, H_k,Nof_Subcarriers,fid)
fprintf(fid,'%f\n',gSNR);
In this file I am calculating a value gSNR storing it and passing it to another file called func2.m
function func2(filenames)
fid = fopen(filenames ,'wt');
data = textscan(fid, repmat('%f',1,numColumns), 'headerlines', headerLength);
However there are are errors such as unable to read any data from file. TEXTSCAN might not have read access.
error in line : data = textscan(fid, repmat('%f',1,numColumns), 'headerlines', headerLength);
and in line : func2(sFileName);
I am not sure how to address these errors, have tried a lot.