I have a matlab script lets say image_process.m and the function image_process accepts one argument which is the picture.
I want to define a path for the images folder so now I can call image_process path image_name.
I know I can do image_process path/image_name but I need to add the extra argument to my function.
I have a matlab script lets say image_process.m and the function image_process accepts one
Share
It is quite easy, just use the fullfile function to combine
If you are using scripts instead of functions, just convert it to functions.
Scripts are bad practice anyway, because they mess with the global workspace, and cause havoc.
Any script can be converted to function.
Call your function like this: