+ Reply to Thread
Results 1 to 3 of 3

Thread: Convert matlab code to C/C++ on Linux

  1. #1
    Newbie Kank is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    1

    Convert matlab code to C/C++ on Linux

    Hi,

    I would like to convert my matlab code to C/C++. I've got some problems.

    1. In my matlab code, I have some differential/integral equations implemented by numerical math (e.g. euler method), so sampling time is specified easily. How can I convert these equations into C/C++ on Linux ? I do not know the sampling time and it has to work realtime.

    2. My work is to track a given trajectory, for example, I can give: x = cos(t) y = sin(t), t is time. So I can get point (x,y) at each time step. When I convert to C/C++ using time from Linux system, I cannot get the correct points on the trajectory.
    Also, in each loop in my program, there are some if/else conditions. The time taken in each case is not constant.

    I know someone can solve these problems easily. It happens all the time when we have to implement something in realtime systems.
    Could anyone please give me some suggestions?

    Thank you in advance.

    Kank

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,687
    Blog Entries
    57
    Unfortunately, you are talking about implementing Numerical Analysis, which can get rather messy in a hurry. If you do a search for numerical integeration you will probably find some results. You may also want to use YACAS to perform some of your work.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Programmer Patrick is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    100
    I did what you said Mr. Winged but please tell me what is YACAS? Is there any other means through which I can solve the same problem?

    Waiting for your reply curiously.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 18
    Last Post: 06-01-2009, 09:05 PM
  2. Basic Calculator
    By AfTriX in forum VB Tutorials
    Replies: 3
    Last Post: 02-29-2008, 08:53 AM
  3. Please Help With A C Program!!
    By siren in forum C and C++
    Replies: 7
    Last Post: 04-17-2007, 08:45 AM
  4. calling C script from via Matlab
    By rattlepanos in forum C and C++
    Replies: 3
    Last Post: 02-16-2007, 11:06 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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