Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Strange output from WHICH for class definition file in package

Asked by per isakson on 2 Dec 2012

I encounter an intermittent problem with class definition files, which are in a package. The function WHICH returns the filespec twice. The second time as shadowed. The first time the drive letter is upper case and the second lower.

After restart of Matlab I don't see the behavior for some time.

How is WHICH supposed to work with a class definition file in a package? The documentation doesn't say. My call with the full filespec might not be legal.

There "cannot" be (and is not) two files with identical names in the same folder.

R2012a, 64bit, Windows 7.

Can somebody comment on this behavior?

.

Example:

>> which -all h:\m\PiaX\test4ida\+test4ida\HasSimulationModelState.m
H:\m\PiaX\test4ida\+test4ida\HasSimulationModelState.m  % test4ida.HasSimulationModelState constructor
h:\m\PiaX\test4ida\+test4ida\HasSimulationModelState.m  % Shadowed test4ida.HasSimulationModelState constructor

(Above the comments are wrapped.)

>> which -all test4ida.HasSimulationModelState.m
'test4ida.HasSimulationModelState.m' not found.
>> which -all HasSimulationModelState.m
'HasSimulationModelState.m' not found.

.

where

    classdef    HasSimulationModelState  < test4ida.State
    % HasSimulationModelState 
        properties
        end
        methods
            function    this = HasSimulationModelState( varargin )
                persistent ipp
                if nargin == 0,    return,     end            
                if isempty( ipp )
                    ipp = InputPreprocessor( {
                        1 'Context'    ''  {'test4ida.IdaTester'}       {}
                        } );
                end
                ipv = ipp.parse( varargin{:} );
                this.context = ipv.Context;
            end
            function    startSimulationProcess( this )
                17;
                this.context.ice_adapter.startSimulation
                this.context.currentState = this.context.simulationStartingState;
                this.context.StartAttemptSdn = now;
                Logger.add( test4ida_message( this.context ) )
            end
        end
    end

0 Comments

per isakson

Products

No products are associated with this question.

0 Answers

Contact us