Search Results

Search found 3 results on 1 pages for 'lollygagger'.

Page 1/1 | 1 

  • Using 'load' in octave

    - by lollygagger
    Is there a way to tell the load function to only load until a certain line? I want to read in a data file and assign the numbers to an array, however, I want it to stop after it has created a 200 X 200. Could I also do this with a do-while loop and fgetl? When I try to use fgetl(fid, len) and give it 'len', it does not obey :-/ How can I tell octave to ignore the comment lines in an input file? They are '#' characters, so I figured octave would just automatically ignore them, but not so... Thanks.

    Read the article

  • Reading input files in FORTRAN

    - by lollygagger
    Purpose: Create a program that takes two separate files, opens and reads them, assigns their contents to arrays, do some math with those arrays, create a new array with product numbers, print to a new file. Simple enough right? My input files have comment characters at the beginning. One trouble is, they are '#' which are comment characters for most plotting programs, but not FORTRAN. What is a simple way to tell the computer not to look at these characters? Since I have no previous FORTRAN experience, I am plowing through this with two test files. Here is what I have so far: PROGRAM gain IMPLICIT NONE REAL, DIMENSION (1:4, 1:8) :: X, Y, Z OPEN(1, FILE='test.out', & STATUS='OLD', ACTION='READ') ! opens the first file READ(1,*), X OPEN(2, FILE='test2.out', & STATUS='OLD', ACTION='READ') ! opens the second file READ(2,*), Y PRINT*, X, Y Z = X*Y ! PRINT*, Z OPEN(3, FILE='test3.out', STATUS='NEW', ACTION='WRITE') !creates a new file WRITE(3,*), Z CLOSE(1) CLOSE(2) CLOSE(3) END PROGRAM PS. Please do not overwhelm me with a bunch of code monkey gobblety gook. I am a total programming novice. I do not understand all the lingo, that is why I came here instead of searching for help in existing websites. Thanks.

    Read the article

  • how to run g95 executable files in OS X terminal

    - by lollygagger
    I am completely new to this game, so please be gentle ;-) I made an example program in Fortran 90, lets call it 'program.f90'. I compile it: g95 program.f90 It creates an executable called a.out How do I run this? It is supposed to print something to the screen, and get input from me, but I cannot figure out how to!

    Read the article

1