Results 1 to 2 of 2

Thread: function returns a matrix with complex entries

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    53

    function returns a matrix with complex entries

    Hi everyone

    I need my function to produce a matrix, then I called the function in the main program by its name to give the matrix to the main program, but it does not work at all, I mean the matrix is computed correctly in the function but I failed to call it to the main program, here what I have in my code

    Code:
    main_program
    c
    complex*16 A(m1,m2), Mat
    EXTERNAL Mat
    c
    A = MainMat(n,m)
    .
    ..
    end
    c  here is the function
    complex*16 function Mat(n,m)
    c calculate the elements of Mat
    Mat = A
    .
    end
    I need to return the matrix Mat, which I computed by the function to the main program

    any help

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: function returns a matrix with complex entries

    You'd probably have more luck in a FORTRAN forum than here. It's not really a math question.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width