Problem Matlab Ubuntu
Show older comments
Hi everyone, i have a problem for running matlab in ubuntu with the path directory. I use this form:
Amoy=Average('./TestProcess/') (The function requires the path directory of the images to process)
So, this doesn't work in ubunto but the strange is that same function works perfectly in windows Xp.
The error shows
Error using => imread at 374
If Anyone can help me I will apreciate
Thanks to all
5 Comments
Walter Roberson
on 9 Nov 2011
What is the error message shown for imread() ?
Daniel Shub
on 9 Nov 2011
REading from the source of imread line 374 in r2011a:
error('MATLAB:imread:fileOpen', 'File "%s" does not exist.', filename);
Walter Roberson
on 9 Nov 2011
And which filename is it that it says does not exist?
Have you tried
cd('./TestProcess')
Amoy = Average('.')
Bhadange Mihir
on 28 May 2021
Hey i can't install matlab on ubuntu. please help
Walter Roberson
on 28 May 2021
Please open a question about installing matlab as it is not relevant to the current topic
Answers (3)
Alex Taylor
on 9 Nov 2011
To get an answer to your question, you should set a breakpoint at the line where you are calling imread. Examine the full path and filename you are passing to imread. It is very likely be that when you do this, it will be a simple unix path vs. windows path issue.
I'd look at the functions fullfile and filesep for help generating platform agnostic paths.
help fullfile
help filesep
Hope this helps.
Alex.
Daniel Shub
on 9 Nov 2011
0 votes
Are all your file separation slashes correct? You can use filesep to handle the / and \ differences. Is the directory your images in readable?
Alex Molina
on 10 Nov 2011
0 votes
7 Comments
Daniel Shub
on 10 Nov 2011
It looks like you are trying to read more than one file.
Alex Molina
on 10 Nov 2011
Alex Molina
on 10 Nov 2011
Walter Roberson
on 10 Nov 2011
imread() can only read one file at a time on any OS.
Your routine "Average" needs to read one file at a time and work that way.
I wonder, by the way, what Average() is intended to do if the images are different sizes?
Alex Molina
on 11 Nov 2011
Alex Molina
on 11 Nov 2011
Walter Roberson
on 11 Nov 2011
And if other images accidentally get put in to the same directory?
Categories
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!