Long Symbolic/Numeric function output

5 Ansichten (letzte 30 Tage)
Carleton university
Carleton university am 17 Jun. 2011
I have a mixture of numeric and symbolic variables as the output vector of my matlab function. This output is too long to be shown on display and it takes too much time and eats up too much memory to be saved in an output file. I believe the main reason for this problem is that numeric variables when combined with symbolic ones are assumed as fractions by matlab; For example instead of having 0.333*x(x is a symbolic variable)I receive 100000000000000001/300000000000000001 *x. Does anyone has any suggestions? I need to have the output faster and in a compact form.
Sam

Antworten (1)

Walter Roberson
Walter Roberson am 17 Jun. 2011
If the expression should be evaluable to a pure numeric, use double() to convert it to double precision. If the expression has some unresolved symbolic variables, use vpa()
  3 Kommentare
Paulo Silva
Paulo Silva am 18 Jun. 2011
Are you doing vpa to the results you get after the calculations or using vpa in some strange other way?
Carleton university
Carleton university am 18 Jun. 2011
after the calculations. The vpa just changes fractions to decimals. That is it. The length of the expression does not change by using vpa. As an example instead of .000000000000000000000001*x in my results I would like to 1e-24*1 or 10e-23*x or 0.1e-25*x or something like these!

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by