0
votes

In Matlab how do I delete cells in a cell array that contains a varaible string. Say my cell array is

 'C:\svnTrunk\RadarLib\radarlb\utilities\scatteredInterpolant.m'
 'C:\svnTrunk\RadarLib\radarlb\utilities\unitize.m'
 'C:\svnTrunk\Simulations\GUIMenu.m'
 'C:\svnTrunk\Simulations\Maritime\GenericModel\CalculateOutputs.m'
 'C:\svnTrunk\Simulations\Maritime\GenericModel\ComputeBeamLayout.m'
 'C:\svnTrunk\Simulations\Maritime\GenericModel\ComputeBeamwidthOnGround3.m'

I want to remove all entries that contain a string varaible = 'GenericModel' so I'd only have

 'C:\svnTrunk\RadarLib\radarlb\utilities\scatteredInterpolant.m'
 'C:\svnTrunk\RadarLib\radarlb\utilities\unitize.m'
 'C:\svnTrunk\Simulations\GUIMenu.m'
1

1 Answers

3
votes

Because today's your lucky day:

A( cellfun('isempty', strfind(A, 'GenericModel')) )

with A of course your cell array.