How can I properly load a file from current folder to workspace?
5 views (last 30 days)
Show older comments
Dear all
I have this code:
%
if exist ('netrb')
load netrb
disp('Neuronová síť byla načtena')
else
load trenovaci_modely1
disp('Trénovací modely byly načteny')
P = [c{1,:}];
T = [c{2,:}];
net = newrb(P,T,0,0.3);
end
save netrb net
disp('Neuronová síť byla uložena')
I would like to load netrb from my current folder, but always when I run this code, it starts to train network as if none exist in my folder. Please advise me, what´s wrong?
0 Comments
Accepted Answer
Stephen23
on 23 Feb 2015
Edited: Stephen23
on 23 Feb 2015
Can you see netrb listed when you use dir in the command window?
You should read the documentation for exist: it is recommended to use both the input and output specifiers to explicitly define what kind of thing you are checking for. Use this to check for a file:
2==exist(...,'file')
You should also specify the filename complete with file extension, as there could be other similar named functions or variables.
load('netrb')
3 Comments
More Answers (0)
See Also
Categories
Find more on File Operations 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!