Sean, thank you VERY much.
"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <i85i8r$2r2$1@fred.mathworks.com>...
> "Raymond " <atlantaswagsurfers3@yahoo.com> wrote in message <i85gt8$31r$1@fred.mathworks.com>...
> > I'm writing a function that takes the first letter of the first subcell, takes the whole second subcell, and takes the corresponding element of the third vector and concatanates them into a output. Examples to help in understanding:
> >
> > in = {{'Ksda','Jasdas','Ias'},{'Swe','Mao','Ori'}, [9 4 2]}
> > out= {'kswe9','jmao4','iori2'}
> >
> > in={{'Dasdasd', 'Eras', 'Ias', 'Sdas'}, {'Wsse', 'Tws', 'Dss', 'Sasd'}, [1 2 3 4]}
> > out={'dwsse1', 'etws2', 'idss3', 'ssasd4'}
> >
> > The inputs will always be in this form of three subcells. Two cells and one vector.
> > Notice that the output will always be lower case.
> >
> >
> >
> > My function so far:
> >
> > function [out] = multicombine(in )
> >
> > a = [];
> > b = [];
> > c = [];
> > for i=1:length(cell{1})
> > a1 = lower(cell{1}(i));
> > a(i) = a1{1}(1);
> > a = char(a);
> > g=lower(cell{2}(i));
> > b=[b char(g{1})];
> > c(i)=cell{3}(i);
> > out(i)=strcat(a(i), b(i), c(i));
> > end
> >
> > end
> >
> > I think it should work, yet it doesn't. Can't figure it out for the life of me.
>
>
> This should be all you need:
> %%
> out = cell(1,length(in{1}));
> for ii=1:length(in{1})
> a = char(in{1}(ii));
> b = char(in{2}(ii));
> c = num2str(in{3}(ii));
> out{ii}=lower([a(1), b, c]);
> end
>
> %SCd
