Directory or path should be given as character array, NOT in cell array. [word,op] = o2w [word,op] = o2w(word,op); o2w(word,op); [word,op] = o2w('E:\Previous BJ\withwangliquePapers'); o2w({'test.opj'},{'E:\'},2,3,word,op); o2w({'test.opj'},'E:\',2,3,word,op,{'opr'}); [word,op] = o2w(0,word,op); o2w({'test.opj';'tersssss.opj'},'E:\',2,3,word,op); filename = {'E:\Previous BJ\withwangliquePapers\OriginFigs\test.opj'} filename = {'E:\Previous BJ\withwangliquePapers\OriginFigs\effect of compressibility (fig6(a)-6(c) & 14(b)) mod2.OPJ'}; grname = {'volumtric'} grname = {'phi';'seepage';'vertical';'volumtric'}; ori2word({'vertical'},[],0,word,op) path = pwd; openword = 1; coprat = 40; whos for batch processing, dir should be different from current dir