Programming :: Octave - Load A Text File With Floating Point Values Into A Matrix?
Jan 29, 2011
I have a .txt file with the format
0.01
0.04
0.07
...
0.83
I am wanting to load this into octave and perform operations on the data.
[Code]...
View 2 Replies
ADVERTISEMENT
Sep 9, 2010
I am dealing with money and I don't want it to show $.1, I'd rather it show $.10 Is there a way to change this in C++?
View 4 Replies
View Related
May 10, 2011
I know it is wrong to use the "==" operator to compare the equality of two floating point numbers. Logically it would seem that if the "==" operator is not usable for floating point comparison, then the "<=" operator would also not be usable. Is this true? The lack of google search results on this topic made me think that it must be true. If that is true, then is it true that the only way to compare floats with <= or >= is with something like the code below? Code: bool smaller_than_or_equal(float a, float b) {
if ( fabs(a-b) < EPSILON){return true;}
else if (a < b) {return true;}
else {return false;}
} I think this is a general question, but if specifics are necessary, I am using the C++ language to code at the moment.
View 5 Replies
View Related
Jun 5, 2011
I'm reading a book on assembly, and it talks a bit about the IEEE floating point format.
Quote:
To summarize, the following steps are used to convert a decimal number to IEEE single format: 1. The leading bit of the floating point format is 0 for a positive number and 1 for a negative number. 2. Write the unsigned number in binary. 3. Write the binary number in binary scientific notation f23.f22 ... f0 2^e, where f23 = 1. There are 24 fraction bits, but it is not necessary to write trailing 0's. 4. Add a bias of 127 to the exponent e. This sum, in binary form, is the next 8 bits of the answer, following the sign bit. (Adding a bias is an alternative to storing the exponent as a signed number.) 5. The fraction bits f22f21 ... f0 form the last 23 bits of the floating point number. The leading bit f23 (which is always 1) is dropped.
View 1 Replies
View Related
Nov 9, 2010
I have a text file that needs to be updated to be used by some fortran code later. it looks like that:
1,1 !Ms for y-stations, Ns for x-stations
0,0,0, !xsta, ysta, zsta
I need to replace the "0,0,0" with new values for xsta,ysta and zsta;
View 4 Replies
View Related
Oct 22, 2010
I have recently installed Octave on my desktop and I am very busy with RTFM ATM.However, this manual is huge and I could not find an answer to my problem. What I basically want to do is initialize a vector like
Code:
a=[]
for i 1:100
a = [ a i ]
endfor
Now my problem is that this will call the pager and I have to hit 'q' to get my prompt back. I know I can turn it off but the screen will still get cluttered with tons of output.Is there a way to initialize 'a' quietly without any screen output?
View 2 Replies
View Related
Jun 28, 2011
I am getting error Fortran runtime error: Bad value during floating point read. How do I format negative sign?
[code]...
View 1 Replies
View Related
Apr 7, 2011
how to perform floating point operations in kernel? i answered that its impossible to perform floating point operations in kernel.but he is telling that its possible but with some feature to be added.can any body know about this perfectly??
View 1 Replies
View Related
May 1, 2010
Over the last few months there have been multiple updates and I am getting a list of things that no longer work or that cause my system to fail. I can no longer open a pdf in firefox. It says there is no application assigned to the task. I ran evince and tried to open a pdf file and received a "floating point" error message on the terminal screen I was working from.
View 1 Replies
View Related
Feb 17, 2011
I have the most strange problem ever in programming. I fork a process into a parent and a child. In every forked process i declare a pointer, malloc and define a different value for every pointer.When i printf the value and the address guess what? They both have the SAME ADDRESS but DIFFERENT values, as assigned..Here's the portion of my code:
pid = fork ();
switch (pid)
{
[code]....
View 8 Replies
View Related
May 15, 2010
My main problem right now is doing floating point arithmetic within a bash script, with variables.Right now I have a folder called "myExamples" with a script called "run_example" that runs with no issues.I plan to(1) create many folders inside [myExamples], that are named [example10] [example11]...each containing an identical copy of (run_example),(2) modify Line 172 of each copy of (run_example)...in one copy, it would be 3.00, the next copy would have 3.05, etc. (This part doesn't work!)How can use the available calculator bc code to do floating point operations?My code is below -
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/(.*)/.*/1/'` # extract pathname
[code]...
View 2 Replies
View Related
Apr 13, 2011
I just can't find... why is my code seg-faulting?
PHP Code:
/*
Code name: Assignment #7.
File name: slice.c
Program name: Matrix multiplication (parallel version).
Version: 1.
[Code]...
Is giving my a seg-fault right at the ending point where I do the final gather from the MASTER processor.
View 9 Replies
View Related
Apr 13, 2010
I'm doing some bash-scripting and want to be able to print some text (just plain text) files into the new bash-scripts, created within a loop. Here's a short example of what I do:
Code:
# main bash script #
#!/bin/bash
##Filename
variable1=10
for ((j=0;j<=40;j+=1))
do
## Create another bash-script
echo "#!/bin/bash" >> bash_script_$j
... some stuff...
cat file1.txt >> bash_script_$j
... some more stuff...
done
where the text file (file1.txt) I want to print in the the new bash script looks something like:
Code:
# file1.txt #
...some stuff...
logsave log some_program($variable1)
mv output_$j folder_$j/
... some more stuff...
I.e, the text file contains variables such as "$j", "$variable1" etc that are undefined. Doing the above works for creating new bash scripts (bash_script_1 - bash_script_40) but the variables are not determined. I would like, if possible, to somehow print the text in file1.txt into the new bash-scripts with the variables determined, i.e:
Code:
# bash_script_1 #
...some stuff...
logsave log some_program(10)
mv output_1 folder_1/
... some more stuff...
The text files I read are quite extensive so I would really prefer not having to paste them into the FOR-loop directly.
View 2 Replies
View Related
Mar 28, 2010
I have tried to learn how 64bit asm (nasm in my case) works and found, among the many disparate pieces of info on the net, a few vague inferences that floating point registers can be used for other purposes than what they are intended for, example: "64-bit Linux allows up to fourteen parameters to be transferred in registers (6 integer and 8 floating point)." This would be fantastic for string operations/manipulation (I have never used asm for floating-point operations), can anyone shed a bit of light?
View 8 Replies
View Related
Feb 18, 2010
pidgin started crashing today for no apparent reason. It just shutdowns. No freezing or anything, it just goes away, disappears. From what I can say, there's no specific trigger for this, it can happen after 2 or 10 min after I started it. Once it even shutdown right 10seconds. I tried to run it from the terminal. When I do that, the only thing that appears before closing is
Code:
Floating point exception Anyone has an idea of what it can be? I made no upgrade to pidgin or libpurple recently. I made however an upgrade today of the following packages
Code:
Commit Log for Thu Feb 18 10:24:00 2010
[Code]...
View 1 Replies
View Related
Jan 5, 2010
I am facing floating point exception issues in running top on some of my Red-Hat Linux servers
# top
6:45am up 476 days, 52 min, 4 users, load average: 0.00, 0.00, 0.00
109 processes: 108 sleeping, 1 running, 0 zombie, 0 stopped
Floating point exception
When I am executing the same command using strace or ltrace, its running fine.
# ls -lrt /usr/bin/top
[Code]...
View 1 Replies
View Related
Jul 1, 2010
I am using a gateway server, 1st NIC eth0 which is acting as WAN (DHCP)and 2nd NIC acting LAN(static). I am using DHCP to assign IP to eth0 from a Wimax modem. I am also use it as a MAIL server (openmail), and as a DHCP server. My server is of RHEL and kernel version is 2.4.8.18-14 and DHCP client & server version - 30pl1-9. The prolem is whenever I run the command..
ifup eth0
getting the error...
Determining IP information for eth0.../ifup: line277: 23328 Floating point exception/sbin/dhclient ${DHCLIENTARGS} ${DEVICE}
so what should I do?? if I update the DHCP, would it be ok?
View 1 Replies
View Related
Mar 12, 2010
games, specifically solitaire and gimp both have started returning a floating point exception fault.
View 9 Replies
View Related
Jan 9, 2011
I had fuzzy icons in system tray so before couple of days i installed some updates and after that i have floating point exception in ktorrent and virtualbox 2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 i686 athlon i386 GNU/Linux
nvidia 9500 GT
X.Org X Server 1.8.0
KDE 4.4.4
Here is the updates
nvidia-gfxG02-kmp-desktop-260.19.21_k2.6.34.0_12-19.1 Tue 04 Jan 2011 04:14:42 PM CET
x11-video-nvidiaG02-260.19.21-20.1
[Code]...
View 4 Replies
View Related
May 27, 2011
This is the first time I post a question on these forums My problem is as follows: I can't start gnome-terminal from the Applications->Accesories menu or from the Alt+F2 application launcher. I get a "Starting Terminal" in the task-bar that disappears after a few seconds and no terminal. I'm pretty sure there is something I did, but I can't really figure out what it is.
The things I've tried so far:
1. I used synaptic to remove and reinstall gnome-terminal. That didn't work
2. Started Xterm and tried to run "gnome-terminal". This is where it gets weird for me:
a. running the command as normal user I get a "Floating point exception" error and obviosly no terminal
b. when I do "sudo gnome-terminal" and enter the root password I get, as expected, a root terminal. I could live with that, but it's not ideal.
View 8 Replies
View Related
Feb 17, 2009
I put an SD card in a reader, got all the right signs from the kernel (SCSI device: sda; write-through; etc.)including its 2GB size.
When I try to mount /dev/sda1 I get 'floating point exception' as a response, and it won't mount.
I've never had that message returned from mount, and I can't find any reference to it.
View 1 Replies
View Related
Apr 14, 2011
One of those odd things I learned the hard way is that if you are writing a shared object (library/.so) and any programs that will link to that library uses floating point numbers, the library must be compiled as if it uses floating point numbers. What that really means is, you need to declare at least one float in the source for the library or when the caller connects and tries to run code in the library, the process aborts.I end up putting a float pi (3.1415); in the code and getting an unused variable warning all the time. There has to be a simpler way, some flag to pass to g++ that says, "include floating point support even if you don't really need to."
p.s. Gosh I hope I remembered this correctly. I encountered this problem doing a multi-platform build for Windows and Linux. This COULD be a VC++ problem that I just carried into Linux by using the same source.
View 1 Replies
View Related
Mar 17, 2011
Just updated WinFF to version 1.3.2-1.1. Since then it won't start up any more due to a floating point exeption. System: OpenSUSE 11.4 (x86) + KDE 4.6.0 Debug info:
WARNING] Out of OEM specific VK codes, changing to unassigned
[WARNING] Out of unassigned VK codes, assigning $FF
ERROR in LCL: TLRSObjectReader.SkipValue unknown valuetype
Creating gdb catchable error:
$080D1568
[Code]...
I had the same error with earlier versions of WinFF in earlier versions of OpenSUSE. Then I could fix it by changing the KDE window styles. The error also occurs with the WinFF qt-version.
View 1 Replies
View Related
Oct 14, 2010
I have been trying to convert a DVD9 to DVD5 using the following steps
1)Rip the DVD title(s) to harddisk with DVD:RIP in a project folder. This created VOB files of the the movie and the soundtrack you picked.
2)Concatenate (merge) the VOB files into one by running in a console: cat *.vob > movie.vob
3)demutliplex movie.vob and get the M2V and AC3 files out of there. tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v
4)tcextract -i movie.vob -a 0 -x ac3 -t vob > movie.ac3
5)I then shrank the movie.m2v tcrequant -i movie.m2v -o shrinked.m2v -f 1.5
[Code]...
View 2 Replies
View Related
Dec 7, 2009
I'm running CentOS 5.4.In the last three days I've started to get various cron errors:
/bin/sh: line 1: 7066 Segmentation fault /usr/local/scripts/cron.email.sshd.access/cron.email.sshd.access.pl
/bin/sh: line 1: 4822 Floating point exceptionsudo -u mobile getmail --quiet
Can't load '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs/RRDs.so'
[code]...
Then yesterday I rebooted, and all the other errors seemed to have disappeared for now, but, I am now getting:
/bin/sh: line 1: 23600 Segmentation fault sudo -u mobile getmail --quiet
I have setup cron to call getmail once every 3 minutes, and I get this error about 4-6 times an hour.
View 11 Replies
View Related
Jul 27, 2010
I am splitting a file based on the values read from an input file. The below one is the script.
1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).
2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?
for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done
View 2 Replies
View Related
May 1, 2011
My script.
This is may script:
Code:
Problem: Output file doest not exclude the values in grep -av
View 3 Replies
View Related
Sep 21, 2010
I need a shell script which gathers the data from a remote XML file and then displays it according to my needs.. I need this for my job due to the fact that I need to keep track price changes of euro, usd, gold, etc. The XML file I am talking about is located at this page: here. The reason I am posting the URL is that I need to use curl to get this file and it does NOT have newlines after each tag. I thought that that would be a problem. Here is what I need from the script: 1) curl to get the page 2) make use of sed, awk, etc. to display its contents in a more structured and readable manner as shown below:
A: 64.125 (% -0.26)
B: 81.130 (% -0.32)
C: 1.4930 (% 0.00)
D: 1.9590 (% 0.36)
View 5 Replies
View Related
Jan 28, 2009
I have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
View 10 Replies
View Related
Nov 13, 2010
I have a huge binary log file. There are lets say 4 id's that I want to find in a log file. I know that those 4 id's will be present in the log file and I also know in what order they will be present. I want to find 1st id from the log then 2nd id and then third id and so on..
Simple/inefficient solution is: Loop through the id's and then grep in the log file. Problem with this solution is for each id grep will search from the beginning of the file.
Better/efficient solution would be: Sine I know the order in which id's will be present in the log file. Loop through id's, grep 1st id and then move on to grep 2nd id and so on...this way I can grep all id's in one pass. Is this solution possible ?
I have 500000 + values to find in log files and I have to find efficient solution for it.
View 2 Replies
View Related