How can I properly load a file from current folder to workspace?
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Stephen23
2015 年 2 月 23 日
編集済み: Stephen23
2015 年 2 月 23 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!