Prev: Simulink example program about boiler drum level
Next: trying to understand uint32, single or int16
From: Abhishek on 23 Jul 2010 10:56 Hi I have TL9<1*39cell>which contains TL9{:}= ans = '1/cgs2+s*cgs2+(s*5)/(1+s*4*7)+s*cgb2' ans = '-1/7' ans = '-gm2' etc of class(ans) ans = char another cell array TL3<1*47>which contains TL3{:} ans = [ empty sym ] ans = gm2 ans = cgs2 etc of class -sym; and third TL4<46*1>which contains TL4{:} ans = 7.6816e-08 of class -double So i am using for j=1:d-1 TL7(j)=subs(TL9{j},{TL3{2:c}},{TL4{:}}); end where d =41 and c=47; But this is giving the error:: ??? Error using ==> sym.sym>char2sym Not a valid symbolic expression. Error in ==> sym.sym at 92 S = char2sym(x); Error in ==> subs at 60 r = subs(sym(f),varargin{:}); Please help me ...... >Thank you...
From: Abhishek on 23 Jul 2010 13:08 "Abhishek " <abhi14jan(a)yahoo.com> wrote in message <i2cai4$k2l$1(a)fred.mathworks.com>... > Hi > I have TL9<1*39cell>which contains > TL9{:}= > ans = > '1/cgs2+s*cgs2+(s*5)/(1+s*4*7)+s*cgb2' > ans = > '-1/7' > ans = > '-gm2' > etc of > class(ans) > ans = > char > another cell array TL3<1*47>which contains > TL3{:} > ans = > [ empty sym ] > ans = > gm2 > ans = > cgs2 > etc of class -sym; > and third TL4<46*1>which contains > TL4{:} > ans = > 7.6816e-08 > of class -double > So i am using > for j=1:d-1 > TL7(j)=subs(TL9{j},{TL3{2:c}},{TL4{:}}); > end > where d =41 and c=47; > But this is giving the error:: > ??? Error using ==> sym.sym>char2sym > Not a valid symbolic expression. > Error in ==> sym.sym at 92 > S = char2sym(x); > Error in ==> subs at 60 > r = subs(sym(f),varargin{:}); > Please help me ...... > >Thank you... >please help >i am stuck
From: albin mathew on 23 Jul 2010 14:12 "Abhishek " <abhi14jan(a)yahoo.com> wrote in message <i2ci9t$dg8$1(a)fred.mathworks.com>... > "Abhishek " <abhi14jan(a)yahoo.com> wrote in message <i2cai4$k2l$1(a)fred.mathworks.com>... > > Hi > > I have TL9<1*39cell>which contains > > TL9{:}= > > ans = > > '1/cgs2+s*cgs2+(s*5)/(1+s*4*7)+s*cgb2' > > ans = > > '-1/7' > > ans = > > '-gm2' > > etc of > > class(ans) > > ans = > > char > > another cell array TL3<1*47>which contains > > TL3{:} > > ans = > > [ empty sym ] > > ans = > > gm2 > > ans = > > cgs2 > > etc of class -sym; > > and third TL4<46*1>which contains > > TL4{:} > > ans = > > 7.6816e-08 > > of class -double > > So i am using > > for j=1:d-1 > > TL7(j)=subs(TL9{j},{TL3{2:c}},{TL4{:}}); > > end > > where d =41 and c=47; > > But this is giving the error:: > > ??? Error using ==> sym.sym>char2sym > > Not a valid symbolic expression. > > Error in ==> sym.sym at 92 > > S = char2sym(x); > > Error in ==> subs at 60 > > r = subs(sym(f),varargin{:}); > > Please help me ...... > > >Thank you... > >please help > >i am stuck >>i think you can try conveting your cell array into sym >>if still it doesnt work then you may try reading the file with perl or any other language you are comfortable with... >may be matlab can't do it .....
From: Walter Roberson on 23 Jul 2010 14:16 Abhishek wrote: > "Abhishek " <abhi14jan(a)yahoo.com> wrote in message > <i2cai4$k2l$1(a)fred.mathworks.com>... >> Hi >> I have TL9<1*39cell>which contains >> TL9{:}= >> ans = >> '1/cgs2+s*cgs2+(s*5)/(1+s*4*7)+s*cgb2' >> ans = >> '-1/7' >> ans = >> '-gm2' >> etc of class(ans) >> ans = >> char >> another cell array TL3<1*47>which contains >> TL3{:} >> ans = >> [ empty sym ] >> ans = >> gm2 >> ans = >> cgs2 >> etc of class -sym; >> and third TL4<46*1>which contains >> TL4{:} >> ans = >> 7.6816e-08 >> of class -double >> So i am using for j=1:d-1 >> TL7(j)=subs(TL9{j},{TL3{2:c}},{TL4{:}}); >> end >> where d =41 and c=47; >> But this is giving the error:: >> ??? Error using ==> sym.sym>char2sym >> Not a valid symbolic expression. >> Error in ==> sym.sym at 92 >> S = char2sym(x); >> Error in ==> subs at 60 >> r = subs(sym(f),varargin{:}); >> Please help me ...... >> >Thank you... >> please help i am stuck You should learn standard debugging techniques. for K = 2 : length(TL3) try subs(TL9{1}, TL3{K}, TL4{K-1}); catch: sprintf('There was a problem at TL3{%d} trying to do %s=%s\n', K, char(TL3{K}), char(TL4{K-1})) end end If that doesn't display anything then the problem is with one of the TL9 and you can use similar techniques to figure out which sub-entry.
From: Andy on 23 Jul 2010 14:58 You can also type: dbstop if error at the command line before running your script. This way it will stop when there is an error and allow you to examine the values of all the variables in the workspace. You can check to see if something is not the right value or not the class you expected.
|
Pages: 1 Prev: Simulink example program about boiler drum level Next: trying to understand uint32, single or int16 |