On Aug 7, 4:00 pm, P <prashanthr...@gmail.com> wrote:
> Hi all,
>
> I have a variable called
>
> sym_dPhi =
> -282270057375923/2361183241434822606848*cos(phis
> +2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
> +1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
> +1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
> +5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> +6355945788037667/1125899906842624)
>
> where phis is created as syms phis.
>
> vpa(sym_dyPhi,5) yields me
> ans =
>
> [ empty sym ]
>
> Why ?
>
> On a parallel line ...
>
> >> syms B
> >> syms c; B = 1 + pi + c
>
> B =
> 1165754695714211/281474976710656+c
>
> >> vpa(B,2)
>
> ans =
> 4.1+c
>
> Works !
>
> How come ? What am I doing wrong ? Any suggestions ?
>
> Thanks,
> ethnicatom
please note even vpa(sym_dyPhi,25) yields me no answer !
In article <1186516859.503046.118710@22g2000hsm.googlegroups.com>, P
<prashanthramu@gmail.com> wrote:
> Hi all,
>
> I have a variable called
>
> sym_dPhi =
> -282270057375923/2361183241434822606848*cos(phis
>
+2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
>
+1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
>
+1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
>
+5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> +6355945788037667/1125899906842624)
>
> where phis is created as syms phis.
>
> vpa(sym_dyPhi,5) yields me
> ans =
>
> [ empty sym ]
>
> Why ?
>
>
> On a parallel line ...
>
> >> syms B
> >> syms c; B = 1 + pi + c
>
> B =
> 1165754695714211/281474976710656+c
>
> >> vpa(B,2)
> ans =
> 4.1+c
>
> Works !
>
> How come ? What am I doing wrong ? Any suggestions ?
>
> Thanks,
> ethnicatom
----------------------
With my ancient version of matlab (4a), 'sym' variables are simply
strings. When I copy your string with its five cosine functions into a
single long string on the command line to define a symbolic variable,
matlab complains that it can't see the end of the string. When I break it
up into five separate command line strings and then concatenate them into
a single string, it works fine. The answer is:
So, at least in my case, the trouble seems to be due to the allowable
length of the command line string, not the length of string matlab's Maple
can handle. It seems possible that your trouble may also be due to some
such limitation on the command line string length, even if your Symbolic
Toolbox itself may be very different from mine.
"P" <prashanthramu@gmail.com> wrote in message
news:1186516859.503046.118710@22g2000hsm.googlegroups.com...
> Hi all,
>
> I have a variable called
>
> sym_dPhi =
> -282270057375923/2361183241434822606848*cos(phis
> +2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
> +1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
> +1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
> +5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> +6355945788037667/1125899906842624)
>
> where phis is created as syms phis.
>
> vpa(sym_dyPhi,5) yields me
> ans =
>
> [ empty sym ]
>
> Why ?
Do you have a typo in your command or in your posting? In the first output,
your variable is named sym_dPhi, while in your command it's sym_dyPhi. If
you had a variable named sym_dyPhi that was empty, VPA would return an empty
sym. Alternately, if the line in this posting has a typo and you're
actually computing vpa(sy_dPhi, 5), what is phis at the time you call VPA?
On Aug 7, 9:48 pm, "Steven Lord" <slord@mathworks.com> wrote:
> "P" <prashanthramu@gmail.com> wrote in message
>
> news:1186516859.503046.118710@22g2000hsm.googlegroups.com...
>
>
>
> > Hi all,
>
> > I have a variable called
>
> > sym_dPhi =
> > -282270057375923/2361183241434822606848*cos(phis
> > +2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
> > +1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
> > +1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
> > +5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> > +6355945788037667/1125899906842624)
>
> > where phis is created as syms phis.
>
> > vpa(sym_dyPhi,5) yields me
> > ans =
>
> > [ empty sym ]
>
> > Why ?
>
> Do you have a typo in your command or in your posting? In the first output,
> your variable is named sym_dPhi, while in your command it's sym_dyPhi. If
> you had a variable named sym_dyPhi that was empty, VPA would return an empty
> sym. Alternately, if the line in this posting has a typo and you're
> actually computing vpa(sy_dPhi, 5), what is phis at the time you call VPA?
>
> --
> Steve Lord
> slord@mathworks.com
Hi Steve,
Thanks for replying !
Sorry about my initial post. I guarantee no typos in my script.
when I call "phis", its still a sym ... meaning I have not substituted
at value. I do that in the next step using subs(sym_dyPhi,some_value).
"P" <prashanthramu@gmail.com> wrote in message
news:1186548206.565623.216510@k79g2000hse.googlegroups.com...
> On Aug 7, 9:48 pm, "Steven Lord" <slord@mathworks.com> wrote:
>> "P" <prashanthramu@gmail.com> wrote in message
>>
>> news:1186516859.503046.118710@22g2000hsm.googlegroups.com...
>>
>>
>>
>> > Hi all,
>>
>> > I have a variable called
>>
>> > sym_dPhi =
>> > -282270057375923/2361183241434822606848*cos(phis
>> > +2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
>> > +1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
>> > +1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
>> > +5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
>> > +6355945788037667/1125899906842624)
>>
>> > where phis is created as syms phis.
>>
>> > vpa(sym_dyPhi,5) yields me
>> > ans =
>>
>> > [ empty sym ]
>>
>> > Why ?
>>
>> Do you have a typo in your command or in your posting? In the first
>> output,
>> your variable is named sym_dPhi, while in your command it's sym_dyPhi.
>> If
>> you had a variable named sym_dyPhi that was empty, VPA would return an
>> empty
>> sym. Alternately, if the line in this posting has a typo and you're
>> actually computing vpa(sy_dPhi, 5), what is phis at the time you call
>> VPA?
>>
>> --
>> Steve Lord
>> slord@mathworks.com
>
> Hi Steve,
>
> Thanks for replying !
>
> Sorry about my initial post. I guarantee no typos in my script.
>
> when I call "phis", its still a sym ... meaning I have not substituted
> at value. I do that in the next step using subs(sym_dyPhi,some_value).
>
> What next ?
I think you're going to need to post:
the content of the sym_dyPhi variable
the content of the phis variable
the value you're substituting into sym_dyPhi
the output of "subs(sym_dyPhi, <the value you're substituting in>)"
On Aug 8, 10:25 am, "Steven Lord" <sl...@mathworks.com> wrote:
> "P" <prashanthr...@gmail.com> wrote in message
>
> news:1186548206.565623.216510@k79g2000hse.googlegroups.com...
>
>
>
> > On Aug 7, 9:48 pm, "Steven Lord" <sl...@mathworks.com> wrote:
> >> "P" <prashanthr...@gmail.com> wrote in message
>
> >>news:1186516859.503046.118710@22g2000hsm.googlegroups.com...
>
> >> > Hi all,
>
> >> > I have a variable called
>
> >> > sym_dPhi =
> >> > -282270057375923/2361183241434822606848*cos(phis
> >> > +2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
> >> > +1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
> >> > +1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
> >> > +5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> >> > +6355945788037667/1125899906842624)
>
> >> > where phis is created as syms phis.
>
> >> > vpa(sym_dyPhi,5) yields me
> >> > ans =
>
> >> > [ empty sym ]
>
> >> > Why ?
>
> >> Do you have a typo in your command or in your posting? In the first
> >> output,
> >> your variable is named sym_dPhi, while in your command it's sym_dyPhi.
> >> If
> >> you had a variable named sym_dyPhi that was empty, VPA would return an
> >> empty
> >> sym. Alternately, if the line in this posting has a typo and you're
> >> actually computing vpa(sy_dPhi, 5), what is phis at the time you call
> >> VPA?
>
> >> --
> >> Steve Lord
> >> sl...@mathworks.com
>
> > Hi Steve,
>
> > Thanks for replying !
>
> > Sorry about my initial post. I guarantee no typos in my script.
>
> > when I call "phis", its still a sym ... meaning I have not substituted
> > at value. I do that in the next step using subs(sym_dyPhi,some_value).
>
> > What next ?
>
> I think you're going to need to post:
>
> the content of the sym_dyPhi variable
> the content of the phis variable
> the value you're substituting into sym_dyPhi
> the output of "subs(sym_dyPhi, <the value you're substituting in>)"
>
> --
> Steve Lord
> sl...@mathworks.com
SOLVED THE MYSTERY !
Rather than providing more on this ... let me tell you guys, when this
happens ! IT happens when MATLAB stops the execution of my code and
goes to some wierd state. I am not able to call or use many functions
examples of which include vpa, subs, tic ... toc etc.
It gives me a wrong error ! It says my code is erroneous but I would
not agree with that cause in a different machine with different
version, the script runs fine !
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.