Plot Problem in Matlab

2 views (last 30 days)
SAP
SAP on 23 Apr 2020
Answered: Sindar on 25 Apr 2020
Hello everyone,
When I start matlab, then I get the following warning in the command window first. And may be because of this error massage has something to do with my script files that involves ploting the pole zero plot of a dynamic system or even stability plot, I dont get anything in the figure window.
Please help in resolving this issue-
Warning: Initializing Handle Graphics failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
MATLAB:nonLogicalConditional
Operands to the || and && operators must be convertible to logical scalar values.
  2 Comments
darova
darova on 23 Apr 2020
Please attach the script you run
SAP
SAP on 25 Apr 2020
Surely.
But can you just identify what does the following lines means which appears on command prompt even before I open any script to run. This error message appears when each time I start Matlab-
Warning: Initializing Handle Graphics failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
MATLAB:nonLogicalConditional
Operands to the || and && operators must be convertible to logical scalar values.

Sign in to comment.

Answers (1)

Sindar
Sindar on 25 Apr 2020
Assuming you have edited the matlabrc, it may be as simple as you having a scalar logical operator (&&, ||) instead of an elementwise one (&, |).
edit matlabrc
will bring you to the file it references.
My untouched one contains this:
%MATLABRC Master startup MATLAB script.
% MATLABRC is automatically executed by MATLAB during startup.
% It sets the default figure size, and sets a few uicontrol defaults.
%
% On multi-user or networked systems, the system manager can put
% any messages, definitions, etc. that apply to all users here.
%
% A STARTUP command is invoked after executing MATLABRC if the file 'startup.m'
% exists on the MATLAB path.
% Copyright 1984-2019 The MathWorks, Inc.
try
% The RecursionLimit forces MATLAB to throw an error when the specified
% function call depth is hit. This protects you from blowing your stack
% frame (which can cause MATLAB and/or your computer to crash).
% The default is set to 500.
% Uncomment the line below to set the recursion limit to something else.
% Set the value to inf if you don't want this protection
% set(0,'RecursionLimit',700)
catch exc
warning(message('MATLAB:matlabrc:RecursionLimit', exc.identifier, exc.message));
end
% Set default warning level to WARNING BACKTRACE. See help warning.
warning backtrace
try
% Text-based preferences
NumericFormat = system_dependent('getpref','GeneralNumFormat2');
% if numeric format is empty, check the old (pre-R14sp2) preference
if (isempty(NumericFormat))
NumericFormat = system_dependent('getpref','GeneralNumFormat');
end
if ~isempty(NumericFormat)
eval(['format ' NumericFormat(2:end)]);
end
NumericDisplay = system_dependent('getpref','GeneralNumDisplay');
if ~isempty(NumericDisplay)
format(NumericDisplay(2:end));
end
if (strcmp(system_dependent('getpref','GeneralEightyColumns'),'Btrue'))
feature('EightyColumns',1);
end
catch exc
warning(message('MATLAB:matlabrc:InitPreferences', exc.identifier, exc.message));
end
try
% Enable/Disable selected warnings by default
warning off MATLAB:mir_warning_unrecognized_pragma
warning off MATLAB:subscripting:noSubscriptsSpecified %future incompatibity
warning off MATLAB:JavaComponentThreading
warning off MATLAB:JavaEDTAutoDelegation
% Random number generator warnings
warning off MATLAB:RandStream:ReadingInactiveLegacyGeneratorState
warning off MATLAB:RandStream:ActivatingLegacyGenerators
warning off MATLAB:class:DynPropDuplicatesMethod
catch exc
warning(message('MATLAB:matlabrc:DisableWarnings', exc.identifier, exc.message));
end
% Clean up workspace.
clear
% Defer echo until startup is complete
try
if strcmpi(system_dependent('getpref','GeneralEchoOn'),'BTrue')
echo on
end
catch exc
warning(message('MATLAB:matlabrc:InitPreferences', exc.identifier, exc.message));
end

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!