Thread: C++ and Simulation

  1. #1
    Registered User
    Join Date
    Aug 2016
    Posts
    12

    C++ and Simulation

    Hi,

    I'm using MATLAB for communication systems simulation, which involves heavy use of mathematics, vectors, and matrices, and of course plotting. Can I use C++ for this purpose? I can give a simple example in MATLAB to see how to write its equivalent in C++. I'm interested in this because I would like to strengthen my ability in C++ by applying it in a field I'm familiar with.

    Thanks

  2. #2
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    C++ is pretty fantastic for scientific and mathematical computing.

  3. #3
    Registered User
    Join Date
    Aug 2016
    Posts
    12
    I know that using C++ is faster in running time compared to MATLAB. However, the programming time is longer, as you will need to program everything from scratch, right? Do you recommend any resources?

  4. #4
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Yeah, there's a lot of popular libraries depending on what you're doing. It's also not that​ bad to roll your own algorithm sometimes though. The STL is actually pretty feature-rich.

  5. #5
    Registered User
    Join Date
    Aug 2016
    Posts
    12
    Quote Originally Posted by MutantJohn View Post
    Yeah, there's a lot of popular libraries depending on what you're doing. It's also not that​ bad to roll your own algorithm sometimes though. The STL is actually pretty feature-rich.
    Actually, I would be happy, at least at the beginning to write my own algorithms, just to strengthen my skills in C++ programming. But I'm not sure how. For example how can I plot vector y vs. vector x? In MATLAB I would write

    Code:
    plot(x,y);
    Where can I find libraries for wireless communication systems, just to get an idea.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Graphical stuff isn't C++'s greatest strengths. There is no standard UI. You will have to look in 3rd party libraries (e.g. Qt, boost). The biggest strength you will in doing the calculations.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting started with simulation
    By h3ro in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 11-12-2006, 03:04 PM
  2. Simulation Problem
    By wu_weidong in forum C Programming
    Replies: 1
    Last Post: 03-10-2005, 01:21 AM
  3. life simulation
    By Lillian in forum C Programming
    Replies: 2
    Last Post: 03-19-2003, 12:03 PM
  4. Simulation
    By CodeJerk in forum C++ Programming
    Replies: 2
    Last Post: 12-09-2002, 10:56 PM
  5. spy++ simulation
    By bennyandthejets in forum Windows Programming
    Replies: 1
    Last Post: 11-20-2002, 09:15 AM

Tags for this Thread