Aptech Systems, Inc. Worldwide Headquarters
Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286
Ready to Get Started?
For Pricing and Distribution
Training & Events
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Q&A: Register and Login
Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Available across the globe, you can have access to GAUSS no matter where you are.
Recent Tagsapplications character vectors CML CMLMT Constrained Optimization datasets dates dlibrary dllcall error error handling errors Excel FANPACMT file i/o floating network GAUSS Engine graphics GUI hotkeys installation Java API license licensing linux loading data matrices matrix matrix manipulation Maxlik MaxLikMT Memory Optmum output PQG graphics proc procs RAM random numbers string functions strings structures threading Time Series writing data
Time Series 2.0 MT
Find out more now
Time Series MT 2.1
When I load text into a matrix element it prints out as +DEN
For a simple example, let’s say that I have a one column Excel file where the first row is the data header. For this case, let’s say it is “GDP”. However, when I read in the column it prints out as +DEN.
x = spreadSheetReadM("myfile.xls", "A1:A127", 1); print x;
+DEN 3.2 2.7 3.0 1.8 ......
Why does the first element not say “GDP”?
When you use the GAUSS function spreadSheetReadM, or xlsReadM or use the load command to read in data from a CSV file, you are telling GAUSS to read in the data as a matrix. The M at the end of xlsReadM stands for ‘matrix’.
Sometimes it is convenient to store character data inside of a matrix. GAUSS allows you to do this. This is called a character vector or character matrix. However, GAUSS is not marking this element as character data. It is storing the characters inside of a double precision number. In other words, the data for this element is essentially the numerical value of each of the characters in the string.
The +DEN you see when you do a normal print means that it is a denormal number (you don’t need to know what a denormal is unless you are curious).
To print out the value as text, you need to prepend the variable with the dollar sign to tell GAUSS to interpret the value as character data. For example assuming that the first element of your x vector from above contains “GDP”:
//print the first element of 'x' as character data print $x;
this should return:
GAUSS does not require you to store characters as character data inside of matrices. You can create strings or string arrays. For example, if the cells A1 and A1 contained “GDP” and “Inflation” respectively, then:
varname = xlsReadSA("myfile.xls", "A1:A2", 1, ""); print varname;
There is also a simple to use GAUSS function cvtos that can transform a character element into a string.