plot array outside of C-program

This is a discussion on plot array outside of C-program within the C Programming forums, part of the General Programming Boards category; Hello, C newbie here. I'd like to be able to plot a simple line graph of an array created in ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    14

    plot array outside of C-program

    Hello,

    C newbie here. I'd like to be able to plot a simple line graph of an array created in my C-program. I can easily plot an array with Octave but how do I get an array from my C-program to Octave?

    Thanks for any help,
    OJ

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,687
    myprog | octave

    Basically, you find out what sort of inputs your plot program can cope with (say from stdin) and you make your C program conform to that interface.

    If it's particularly crusty, you may need a file
    myprog -out=temp.txt
    octave -in=temp.txt


    Essentially, a series of printf statements to output the array as text is one way.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    14
    Thanks for the reply.
    I think i kind of did like you said. I sent my output to a text file, then that file into octave.

    Thanks again,
    OJ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 02-08-2009, 08:26 PM
  2. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 02:30 PM
  3. help with small program. array issue
    By InvariantLoop in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 12:26 PM
  4. Type and nontype parameters w/overloading
    By Mr_LJ in forum C++ Programming
    Replies: 3
    Last Post: 01-02-2004, 12:01 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21