Enjoy an Ads-Free Jets Insider - Become a Jets Insider VIP!
Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: OT computer help? - Matlab

  1. #1
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like

    OT computer help? - Matlab

    is anyone good with Matlab, by any chance?

    specifically using the "mex" function to run c files.

  2. #2
    Veteran
    Join Date
    May 2004
    Posts
    2,196
    Post Thanks / Like
    [QUOTE=loluchka80]is anyone good with Matlab, by any chance?

    specifically using the "mex" function to run c files.[/QUOTE]

    College students seriously need to learn how to "Search The Internet." I've been thinking about writing a proposal to the college advisory council explaining to them the need for such a course. So, yeah, STFW -- Google it.

  3. #3
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=Brain Hemorrhage]College students seriously need to learn how to "Search The Internet." I've been thinking about writing a proposal to the college advisory council explaining to them the need for such a course. So, yeah, STFW -- Google it.[/QUOTE]

    hey man, you shut the f*ck up. i was very reluctant to even ask anyone at this form. i've been "searching the internet" for about 3 hours now. and i'm still trying. i figured i'd give it a shot. i'm not the expert programmer, and i have a feeling that my problem is something simple, so i figured i'd see if anyone here could give me a hand.

  4. #4
    Veteran
    Join Date
    May 2004
    Posts
    2,196
    Post Thanks / Like
    [QUOTE=loluchka80]hey man, you shut the f*ck up. i was very reluctant to even ask anyone at this form. i've been "searching the internet" for about 3 hours now. and i'm still trying. i figured i'd give it a shot. i'm not the expert programmer, and i have a feeling that my problem is something simple, so i figured i'd see if anyone here could give me a hand.[/QUOTE]

    You said word-for-word:

    [quote]using the "mex" function to run c files[/quote]

    I put that directly into Google and I was overwhelmed with the number of tutorials that came up.

  5. #5
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=Brain Hemorrhage]You said word-for-word:



    I put that directly into Google and I was overwhelmed with the number of tutorials that came up.[/QUOTE]

    and do you think i haven't read all the tutorials?? you stupid f*cking idiot. mind your own business.

  6. #6
    Veteran
    Join Date
    May 2004
    Posts
    2,196
    Post Thanks / Like
    [QUOTE=loluchka80]and do you think i haven't read all the tutorials?? you stupid f*cking idiot. mind your own business.[/QUOTE]

    then you should probably clarify what you need help with. if you have read the tutorials then you probably only need someone to explain a small peice of information. specify that.

    i'm not an idiot. i'm a hardass.

  7. #7
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=Brain Hemorrhage]then you should probably clarify what you need help with. if you have read the tutorials then you probably only need someone to explain a small peice of information. specify that.

    i'm not an idiot. i'm a hardass.[/QUOTE]

    well, i was first trying to find out if anyone even knows matlab. once someone responded, then i was going to specify my question.

  8. #8
    Jets Insider VIP
    Join Date
    Jan 2006
    Location
    One hour. from MetLife
    Posts
    21,393
    Post Thanks / Like

    I used MATLAB many years ago

    I used MATLAB many years ago to display and execute certain Math functions;however, the latest MATLAB is a lot more complex. I found a link that seems to be pretty (no guarantees) [url]http://cnx.org/content/m12348/latest/[/url]

    [B]Here's the first para. checkout the rest[/B]

    The MATLAB M-File is very good for putting together functions or scripts that run many of MATLAB's fast Built-In functions. One nice thing about these files is that they are never compiled and will run on any system that is already running MATLAB. MATLAB achieves this by interpreting each line of the M-File every time it is run. This method of running the code can make processing time very slow for large and complicated functions, especially those with many loops because every line within the loop will be interpreted as a new line, each time through the loop. Good MATLAB code avoids these things by using as many Built-In features and array operations as possible (because these are fast and efficient). Sometimes this is not enough...
    MATLAB has the capability of running functions written in C. The files which hold the source for these functions are called MEX-Files. The mexFunctions are not intended to be a substitue for MATLAB's Built-In operations however if you need to code many loops and other things that MATLAB is not very good at, this is a good option. This feature also allows system-specific APIs to be called to extend MATLAB's abilities (see the Serial Port Tutorial for an example of this).
    This document is arranged in the following manner:

    * The MEX-Function: Interface to MATLAB
    * Getting and Creating Data
    * Calling Built-In Functions from a MEX-File
    * Compiling
    * Useful Functions not Mentioned Here

    These are some of the basic topics that will allow you to create a MEX-file in a short time. There are many other features and abilities that MATLAB has which can be explored in the MATLAB documentation.
    The MEX-Function: Interface to MATLAB
    When writing programs in C, it is always assumed that the program will start execution from the main(). MEX -Files are similar in that they always start execution from a special function called the mexFunction. This function has return type void and is the "gateway" between the MATLAB function call, and your C code.
    Example 1

    //You can include any C libraries that you normally use
    #include "math.h"
    #include "mex.h" //--This one is required

    void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
    {
    //All code and internal function calls go in here!

    return;
    }


    In order to make a mex-function, you must include the "mex.h" library. This library contains all of the APIs that MATLAB provides. There are four input parameters to the mexFunction which correspond to the way a function is called in MATLAB - (ex: [z0,z1] = jasonsFunction(x,y,z);)

    * nlhs (Type = int): This paramter represents the number of "left hand side" arguments. So in my example function call, nlhs = 2 (the outputs are z0 and z1).
    * plhs (Type = array of pointers to mxArrays): This parameter is the actual output arguments. As we will see later, an mxArray is MATLAB's structure for holding data and each element in plhs holds an mxArray of data.
    * nrhs (Type = int): Similar to nlhs, this paramter holds the number of "right hand side" arguments.
    * prhs (Type = const array of pointers to mxArrays): This array hold all of the pointers to the mxArrays of input data for instance, prhs[0] holds the mxArray containing x, prhs[1] holds the mxArray containing y, etc).

  9. #9
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    thanks a lot RMJK. i think i just got it to work.

  10. #10
    Jets Insider VIP
    Join Date
    Jan 2006
    Location
    One hour. from MetLife
    Posts
    21,393
    Post Thanks / Like

    Your welcome

    [QUOTE=loluchka80]thanks a lot RMJK. i think i just got it to work.[/QUOTE]

    Glad to here it. :)

  11. #11
    Veteran
    Join Date
    May 2004
    Posts
    2,196
    Post Thanks / Like
    [QUOTE=loluchka80]thanks a lot RMJK. i think i just got it to work.[/QUOTE]

    You do realize the link he gave you was from the first search result Google returned when I quoted you word-for-word? [url]http://www.google.com/search?q=+using+the+%22mex%22+function+to+run+c+files&hl=en&lr=&safe=off&start=0&sa=N[/url]

    Let me reiterate: Learn to search the web.

  12. #12
    Veteran
    Join Date
    May 2004
    Posts
    2,196
    Post Thanks / Like
    [QUOTE=RMJK]Glad to here it. :)[/QUOTE]

    You are a kinder man than I, RMJK. :)

  13. #13
    Jets Insider VIP
    Join Date
    Jan 2006
    Location
    One hour. from MetLife
    Posts
    21,393
    Post Thanks / Like

    We can all use a helping hand now and then

    [QUOTE=Brain Hemorrhage]You are a kinder man than I, RMJK. :)[/QUOTE]

    We can all use a helping hand now and then. :)

  14. #14
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=Brain Hemorrhage]You do realize the link he gave you was from the first search result Google returned when I quoted you word-for-word? [url]http://www.google.com/search?q=+using+the+%22mex%22+function+to+run+c+files&hl=en&lr=&safe=off&start=0&sa=N[/url]

    Let me reiterate: Learn to search the web.[/QUOTE]

    seriously dude, what's your problem? mind your own god damn business.

    i actually had seen the link RMJK sent me, and it didn't help me. but i saw that he had actually put some time into trying to help me out, so i thanked him. i was trying to be nice. (I really do appreciate RMJK's help).

    i eventually figured out how to work it on my own shortly after RMJK's post. I wasn't waiting around for people to respond to my post, but that's besides the point.

    so in the future, stop critizing people. let ME reiterate: mind your own business.
    Last edited by loluchka80; 03-08-2006 at 10:51 PM.

  15. #15
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=Brain Hemorrhage]then you should probably clarify what you need help with. if you have read the tutorials then you probably only need someone to explain a small peice of information. specify that.

    i'm not an idiot. i'm a hardass.[/QUOTE]

    i'm afraid that you are an idiot.

  16. #16
    All Pro
    Join Date
    Apr 2003
    Posts
    9,983
    Post Thanks / Like
    [QUOTE=loluchka80]i'm afraid that you are an idiot.[/QUOTE]

    not that i am involved in this in any way, or know what matlab is, but you should watch your language when addressing people you donít know personally, telling someone to shut the f*ck up for asking you to research something just shows your class or lack there off.

    FYI if i really wanted to i could find a tutorial on making an atomic bomb on the internet so if you spent 3 hours on this, you may need that class on research after all.

  17. #17
    All League
    Join Date
    Feb 2005
    Location
    Long Island, NY
    Posts
    3,406
    Post Thanks / Like
    [QUOTE=emslave]not that i am involved in this in any way, or know what matlab is, but you should watch your language when addressing people you donít know personally, telling someone to shut the f*ck up for asking you to research something just shows your class or lack there off.

    FYI if i really wanted to i could find a tutorial on making an atomic bomb on the internet so if you spent 3 hours on this, you may need that class on research after all.[/QUOTE]

    FYI, he told me to shut the f*ck up first. and 2nd of all, don't tell me that i need a class on research. like you said, you don't even know what matlab is. you don't know what you're talking about, or who you're talking to.

    and by the way, you couldn't find a tutorial on how to make an atomic bomb. maybe just the basics. it takes a team of nuclear physicists years to make one.
    Last edited by loluchka80; 03-09-2006 at 11:04 AM.

  18. #18
    Board Moderator
    Join Date
    Sep 2005
    Location
    Brooklyn Heights
    Posts
    2,462
    Post Thanks / Like
    FYI - the two of you sound like a couple teenage girls in this childish bickering....

  19. #19
    All Pro
    Join Date
    Apr 2003
    Posts
    9,983
    Post Thanks / Like
    [QUOTE=loluchka80]FYI, he told me to shut the f*ck up first. and 2nd of all, don't tell me that i need a class on research. like you said, you don't even know what matlab is. you don't know what you're talking about, or who you're talking to.

    and by the way, you couldn't find a tutorial on how to make an atomic bomb. maybe just the basics. it takes a team of nuclear physicists years to make one.[/QUOTE]

    1. i dont see him saying shut the f*ck up first, but if thats the case i take it back.

    2. should i give damn who or what you are? or who i am talking to?

    3. and u know that i am not a nuclear physicists how? :D

  20. #20
    Board Moderator
    Join Date
    Sep 2005
    Location
    Brooklyn Heights
    Posts
    2,462
    Post Thanks / Like
    [QUOTE=emslave]

    3. and u know that i am not a nuclear physicists how? :D[/QUOTE]

    Funny how he took your first comment about that seriously.

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
  •  

Follow Us