Notices
Results 1 to 10 of 10

Thread: Fortran or Matlab instead of C++

  1. #1 Fortran or Matlab instead of C++ 
    Forum Junior AndresKiani's Avatar
    Join Date
    Jan 2014
    Posts
    247
    Is Fortran or Matlab a better language/application program for a science major only trying to simulate analytic analysis. As opposed to C++ or Java and their editors to do this task?

    I already have a good knowledge of C++, because I was a software engineering major before a Neuroscience major. But I know people in my major have an easier and more efficient time working with their data using Fortran and Matlab.


    Reply With Quote  
     

  2.  
     

  3. #2  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,499
    It depends how you define "better"; in this case it may mean "used by many other people in my area of work". If you are working/interacting with people who use Fortran and/or MATLAB to build their models, then those are probably the appropriate languages to use. If you are writing some standalone code then you could use the language you are most familiar with, the one that has the most useful libraries, the one you want to learn next or ....


    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  4. #3  
    Forum Junior AndresKiani's Avatar
    Join Date
    Jan 2014
    Posts
    247
    Quote Originally Posted by Strange View Post
    It depends how you define "better"; in this case it may mean "used by many other people in my area of work". If you are working/interacting with people who use Fortran and/or MATLAB to build their models, then those are probably the appropriate languages to use. If you are writing some standalone code then you could use the language you are most familiar with, the one that has the most useful libraries, the one you want to learn next or ....
    More efficient, sorry English is not my first language.
    Reply With Quote  
     

  5. #4  
    Forum Junior AndresKiani's Avatar
    Join Date
    Jan 2014
    Posts
    247
    More efficient, sorry English is not my first language. With C++ is such a heavy language, I have never worked with Fortran. Though have worked extensively with C++.

    For example, if I need to just simulate a situation analytically instead of experimentally, I would use C++ to give me as many outcomes as possible, though the load of the program can sometimes reach well beyond its efficiency (time and results
    Reply With Quote  
     

  6. #5  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,499
    It depends how you define "efficient".

    For example, it may be more efficient in development time to use a high-level modelling language like MATLAB. But it will almost certainly be more efficient in execution time to run a program written in C++ or Fortran.

    For example, in the project I am working on at the moment, a lot of the research work is done using MATLAB models (for ease of development). But these are later translated to C/C++ code to run on embedded processors.
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  7. #6  
    Forum Junior AndresKiani's Avatar
    Join Date
    Jan 2014
    Posts
    247
    Quote Originally Posted by Strange View Post
    It depends how you define "efficient".

    For example, it may be more efficient in development time to use a high-level modelling language like MATLAB. But it will almost certainly be more efficient in execution time to run a program written in C++ or Fortran.

    For example, in the project I am working on at the moment, a lot of the research work is done using MATLAB models (for ease of development). But these are later translated to C/C++ code to run on embedded processors.

    Development time efficiency no doubt, there is no need for such an efficient execution time for the simulations I'll be needing to conduct. But I know a lot of people in my field use Fortran over C++, and people in the field are more comfortable working with Fortran than C++ it seems.

    Do you yourself translate your MATLAB models to C++?
    Reply With Quote  
     

  8. #7  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,499
    I think there are a lot of reasons that Fortran is widely used in science: it was one of the first languages designed for numerical computations so there are a lot of math and application libraries, a lot of open source applications, a lot of experience, and good tools/infrastructure support. I think there has been some move to C/C++ (I used to work for a company that was involved in high-performance computing but I didn't have much exposure to it myself.)

    And, no I have no experience using MATLAB. (I don't get to do much programming nowadays )
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  9. #8  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Programming in any language is pretty much the same to within a certain factor. C++, MATLAB and Fortran each have their own strengths and weaknesses, but you can do anything in any language eventually. The bigger question is whether or not it'll be worth the time to learn a new language. If you're already familiar with C++ and have never used any other language, it might take quite a while to get used to Fortran or MATLAB. But once you learn several languages, you can use whichever is most appropriate to the task at hand. (There's never a best language.)
    Reply With Quote  
     

  10. #9  
    Forum Junior AndresKiani's Avatar
    Join Date
    Jan 2014
    Posts
    247
    Quote Originally Posted by MagiMaster View Post
    Programming in any language is pretty much the same to within a certain factor. C++, MATLAB and Fortran each have their own strengths and weaknesses, but you can do anything in any language eventually. The bigger question is whether or not it'll be worth the time to learn a new language. If you're already familiar with C++ and have never used any other language, it might take quite a while to get used to Fortran or MATLAB. But once you learn several languages, you can use whichever is most appropriate to the task at hand. (There's never a best language.)
    Another problem I face with C++, is that not a lot of science majors outside of computer science, use C++. It seems as though Fortran and MATLAB are preferred over C++.

    Also what type of editors do you guys use, I use Code Blocks. I've used a lot of different editors over the years.
    Reply With Quote  
     

  11. #10  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    I use Visual Studio for C++ and C#. MATLAB uses it's own IDE. I don't use Fortran, so no suggestions for an IDE there. I also use ideone.com for little things.

    Whether you should pick up either of the other languages depends on a lot of factors, but "better" isn't really one of them. If you need this short term, stick with what you know or you'll waste more time learning the new language than you'd save using it. If you need this long term, learn every language you can. If you need to work with a specific library or team, use what they're using. Etc.
    Reply With Quote  
     

Similar Threads

  1. Need code of Matlab
    By Nawla in forum General Discussion
    Replies: 1
    Last Post: December 8th, 2012, 09:08 AM
  2. Questions regarding statistics and matlab
    By tro in forum Mathematics
    Replies: 5
    Last Post: November 1st, 2012, 12:52 PM
  3. MatLab questions
    By danielgcosta in forum Computer Science
    Replies: 0
    Last Post: November 14th, 2010, 09:43 PM
  4. Matlab
    By thyristor in forum Computer Science
    Replies: 5
    Last Post: August 25th, 2010, 10:18 PM
  5. MatLab question
    By ArezList in forum Mathematics
    Replies: 0
    Last Post: January 8th, 2010, 04:06 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •