Thread Subject: output format

Subject: output format

From: munir

Date: 6 Nov, 2009 08:57:58

Message: 1 of 3

dear all,
i m first time doing matlab coding.
the output in my matrix is coming in the form of expressions, ratios
but i want simple values as output.
for example

ans is coming like
[142*7383/2424*pi 142*7383/2424*pi]
[142*7383/2424*pi 142*7383/2424*pi]

but i want ans like
[1.3587e+003 1.3587e+003]
[1.3587e+003 1.3587e+003]

guide me to get such managable answers.

thanks and regards.

Subject: output format

From: Steven Lord

Date: 6 Nov, 2009 14:39:57

Message: 2 of 3


"munir" <munirpansare@gmail.com> wrote in message
news:c4d242e0-8944-43f6-9047-d743e1fffde3@a39g2000pre.googlegroups.com...
> dear all,
> i m first time doing matlab coding.
> the output in my matrix is coming in the form of expressions, ratios
> but i want simple values as output.
> for example
>
> ans is coming like
> [142*7383/2424*pi 142*7383/2424*pi]
> [142*7383/2424*pi 142*7383/2424*pi]
>
> but i want ans like
> [1.3587e+003 1.3587e+003]
> [1.3587e+003 1.3587e+003]
>
> guide me to get such managable answers.

Convert the symbolic object into doubles using the DOUBLE function (only
works if the symbolic expression does not contain any symbolic variables --
2*pi would work, but 2*t would not.) Alternately, if your object does
contain symbolic variables, use VPA.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: output format

From: munir

Date: 6 Nov, 2009 15:50:13

Message: 3 of 3

On Nov 6, 7:39 pm, "Steven Lord" <sl...@mathworks.com> wrote:
> "munir" <munirpans...@gmail.com> wrote in message
>
> news:c4d242e0-8944-43f6-9047-d743e1fffde3@a39g2000pre.googlegroups.com...
>
> > dear all,
> > i m first time doing matlab coding.
> > the output in my matrix is coming in the form of expressions, ratios
> > but i want simple values as output.
> > for example
>
> > ans is coming like
> > [142*7383/2424*pi    142*7383/2424*pi]
> > [142*7383/2424*pi    142*7383/2424*pi]
>
> > but i want ans like
> > [1.3587e+003   1.3587e+003]
> > [1.3587e+003   1.3587e+003]
>
> > guide me to get such managable answers.
>
> Convert the symbolic object into doubles using the DOUBLE function (only
> works if the symbolic expression does not contain any symbolic variables --  
> 2*pi would work, but 2*t would not.)  Alternately, if your object does
> contain symbolic variables, use VPA.
>
> --
> Steve Lord
> sl...@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ

thank u very much

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com