From: isabelle robitaille on 15 Mar 2010 11:03 hallo,please i need your help, I want to modify a content of a cell . x='11011011' ( class(x) is cell ) how can I put in every 1 the number 0 and in every 0 the number 1,so at the end i have x='00100100' thanx
From: kinor on 15 Mar 2010 11:21 "isabelle robitaille" <isabelle.robitaille(a)yahoo.fr> wrote in message <hnli7p$dv6$1(a)fred.mathworks.com>... > hallo,please i need your help, > I want to modify a content of a cell . > x='11011011' ( class(x) is cell ) > how can I put in every 1 the number 0 and in every 0 the number 1,so at the end i have > x='00100100' > > thanx not elegant but working.. %find '1' and '0' idx1 = strfind(x,'1'); idx2 = strfind(x,'0') %replace x{1}(idx1{:}) = '0' x{1}(idx2{:}) = '1'
From: Walter Roberson on 15 Mar 2010 11:45 isabelle robitaille wrote: > hallo,please i need your help, > I want to modify a content of a cell . > x='11011011' ( class(x) is cell ) > how can I put in every 1 the number 0 and in every 0 the number 1,so at > the end i have > x='00100100' cellfun(@(v) char('0' + v == '0'), x, 'Uniform, 0);
|
Pages: 1 Prev: Using Matlab Builder JA Next: Associate .m file to Matlab editor |