matlab - Open file local to function file in Octave -


i'm trying matlab project work under octave. project's layout looks this:

/myproject/funcs/f1.m                 /data.csv           /examples/test.m 

i want run routine test.m, makes use of function f1. inside f1.m, there's call open data file:

[...] data = dlmread('data.csv'); % read csv file [...] 

when i'm inside examples directory, fails:

error: dlmread: unable open file 'data.csv' 

so guess i'm looking way tell octave file data.csv is in same directory function definition trying open it. solution should matlab-compatible, can contribute changes necessary make work under octave project.

what tried:

  1. data = dlmread('./data.csv'); -> same error before


Comments