필터 지우기
필터 지우기

How to avoid warning and make addpath work in R2012b

조회 수: 1 (최근 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개)

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 CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by