title: splitting a string in matlab
body: <p>In order to make this question easier to describe I have provided the following example code, which is similar to the actual data I am working with: </p>
  
  <pre><code>clear all
  AirT = {rand(32,1),rand(32,1),rand(32,1),rand(32,1)};
  SolRad = {rand(32,1),rand(32,1),rand(32,1),rand(32,1)};
  Rain = {rand(32,1),rand(32,1),rand(32,1),rand(32,1)};
  Location = {'England','Wales','Scotland','Ireland'};
  points = {'old','old','old','new'};
  CorrVariables = {'AirT','SolRad','Rain'};
  for i = 1:length(Location);
      Data = @(location) struct('Location',location,CorrVariables{1},AirT{i},...
          CorrVariables{2},SolRad{i},CorrVariables{3},Rain{i});
      D(i) = Data(Location{i});
  end
  FieldName = {D.Location};
  R = corrcoef([D.AirT],'rows','pairwise');
  R_Value = [Location(nchoosek(1:size(R,1),2)) num2cell(nonzeros(tril(R,-1)))];
  q = points(nchoosek(1:size(R,1),2));
      %to calculate the combination of these points we need to convert the
      %cell into a matrix.
  Re = [R_Value q];
  </code></pre>
  
  <p>From this example I would like to create another cell array in column 5 of Re which is dependant on the strings in columns 4 and 5. So, if columns 4 and 5 in Re are equal, such as 'old''old' then column 6 should show 'old'. However, if the cells differ e.g. 'old' 'new' then I would like the new cell  array (i.e. column 6 in Re) to state 'old/new'. </p>
  
  <p>How would this be possible? </p>