gnuplot: how to use a*(10^b) format on axis - axis

I am using really big numbers (milions) on my x-axis, so when I use
set format x %6.0f
I got big numbers like 25000000. That is quite nice, but takes much space, so there are only few labels and reader losts information.
When I exclude setting format, I get something like 2e+07, what is quite unfriendly and unusual to reader according to my opinion.
I would like format like 25*(10^6), so the number would be first and then multiplied by 10^n, or something very similiar to that. I think that would be the best solution, if the x-axis is long about 30000000 points or even more.
However, reading manuals, e.g. "How do I change the format of the numbers ?" from http://t16web.lanl.gov/Kawano/gnuplot/tics-e.html did not help me much.
Thank you in advance.

All format specifiers that gnuplot has to offer can be found here.
If you don't like the 2e+07 format you could try setting the format with
set format x "%.0s*10^{%T}"
which gives you a format like 15*10^6.

Also one can use the following to obtain scientific notation with cross symbol: 2x10^6
set format x "%2.0t{/Symbol \264}10^{%L}"

Related

kdb - issue with reading floating numbers

I am reading covariance data from flat files. For that reason, not being able to fully read the floating number results in covarince not satisfying positive semi definite requirements.
For instance, this is one of the input from raw text:
“-0.581050672”— no, actually raw text is this: -5.801050672E-01
When I read this into kdb and cast with F, it results in -0.50810507. When I do this for all and check the covariance, unfortunately it does not satisfy PSD constraints. Other hack I have been doing is to add small noise in Identity matrix…
Apart from this hack, is there way to read above data into proper floating number up to 9th digit? I tried \P and .Q.f but these only seem to work in Display.
Thank you
Sorry, does not seem like a kdb issue. Was exporting these data into different software and floating points were lost during this process. Thanks for pointer.

How to set Matlab not to use or use always regional number formatting?

My Matlab sometimes uses regional number formatting, and sometimes does not. May I ask it to do this always or may be not to do this at all?
As you see, it uses comma as decimal separator in one line of property editor and uses period as separator in neighboring lines.
As mentioned in the comments, this is not a feature but a bug.
I have tried to reproduce it in version 2012b, but was unable to input non-integer numbers for x, y and z. If this was not possible before it would explain why it has gone unnoticed until now.
So, please post a bug report and it will probably be fixed in one of the the next versions that is published.

Generating txt file in complex format from Matlab datas

I'm relatively new to Matlab and currently using it to calculate pressure cards for rapid dynamic applications on RADIOSS.
The function is done and can calculate Time-Pressure points.
For the moment I generated only .ascii files to import as curves into the software but I'd like to directly write a text file readable by RADIOSS. (after conversion)
The formatting I need is very specific and I'd like to know if such a thing is possible to do on Matlab. I've been searching on my own for some time now and didn't find really specific formatting options so I come seeking for your advice.
For example I have n time Arrays Te{1 to n} an n Pressure Arrays Pr{1 to n} the format needed is presented in the image linked. How can it be done if it is possible ?
The sprintf function is quite powerful and should provide all the facilities you need. Having looked at the image you linked, I don't see anything particularly special.

MATLAB date number too short - how to get MATLAB to stop shortening my Serial Date Number

I need to extract the dates from a set of data s.
I use the command s(x).comm.date where x can be changed for each person however it is returning the serial date number as 7.3244e+005 which just gives me the day but I need it to show much more detail something like this 732162.65994213.
I don't know if the data I have is already saving it as the shorthand format but it's a set of data from MIT and the help documentation shows it as the long hand format so I sincerely doubt this.
Yours,
MATLAB Newbie
Try typing the following help format or format long (for starters).
By default, Matlab displays 5 significant digits (calculations are done in appropriate floating-point precision, no matter how those variables are displayed). Refer to the documentation for different ways of displaying.

Problem with very small numbers?

I tried to assign a very small number to a double value, like so:
double verySmall = 0.000000001;
9 fractional digits. For some reason, when I multiplicate this value by 10, I get something like 0.000000007. I slighly remember there were problems writing big numbers like this in plain text into source code. Do I have to wrap it in some function or a directive in order to feed it correctly to the compiler? Or is it fine to type in such small numbers in text?
The problem is with floating point arithmetic not with writing literals in source code. It is not designed to be exact. The best way around is to not use the built in double - use integers only (if possible) with power of 10 coefficients, sum everything up and display the final useful figure after rounding.
Standard floating point numbers are not stored in a perfect format, they're stored in a format that's fairly compact and fairly easy to perform math on. They are imprecise at surprisingly small precision levels. But fast. More here.
If you're dealing with very small numbers, you'll want to see if Objective-C or Cocoa provides something analagous to the java.math.BigDecimal class in Java. This is precisely for dealing with numbers where precision is more important than speed. If there isn't one, you may need to port it (the source to BigDecimal is available and fairly straightforward).
EDIT: iKenndac points out the NSDecimalNumber class, which is the analogue for java.math.BigDecimal. No port required.
As usual, you need to read stuff like this in order to learn more about how floating-point numbers work on computers. You cannot expect to be able to store any random fraction with perfect results, just as you can't expect to store any random integer. There are bits at the bottom, and their numbers are limited.