フィルターのクリア

How to avoid warning and make addpath work in R2012b

3 ビュー (過去 30 日間)
Fedor
Fedor 2013 年 4 月 18 日
I need to have different paths for different projects. What I used to do is to change path in pathtool, go to the working folder of the current project, and save the path there, using
savepath pathdef.m
Then, if I come back to the project, I changed the current folder to the project folder, and did
addpath('pathdef.m');
That restored path for the current project. This way doesn't work anymore for R2012b. It produces warning
"Warning: Directory access failure: pathdef.m"
and does not change the path. The solution I found is to use
addpath(pathdef());
instead.
  1 件のコメント
yagnesh
yagnesh 2013 年 4 月 18 日
warning off all

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2013 年 4 月 18 日
See this code snippet of mine. Then read the directions carefully to find out the ID number of your error message, then adapt the code to turn off that particular warning. It's safer to do that than to turn off all warnings.
% Turn off this warning "Warning: Image is too big to fit on screen; displaying at 33% "
% To set the warning state, you must first know the message identifier for the one warning you want to enable.
% Right after your line of code generates the error,
% query the last warning to discover the warning identifier. For example:
% warnStruct = warning('query', 'last')
% messageID = warnStruct.identifier
% In the command window, this will show:
% messageID =
% MATLAB:concatenation:integerInteraction
% Pass that into the warning function:
warning('off', 'Images:initSize:adjustingMag');

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by