matlab field/column?

Discussion in 'Programmer's Corner' started by Judas543, Apr 25, 2010.

  1. Judas543

    Thread Starter Member

    Jan 26, 2010
    60
    0
    You add a new column or field to your database (depending on the format you have decided for your array) that
    contains the “Astrological Sign”. Note: The astrological signs are presented in the “Astrology Chart” at the end of
    this document .

    Now you create a new array (you decide the format) containing the following information:

    The astrological sign (women only)

    The number of women with this astrological sign

    The astrological sign (men only)

    The number of women with this astrological sign

    If according to your website wizard a perfect match is “a man and a woman having the same astrological sign”,
    how many “perfect matches” do you have in your database?
    Verify your result: display the matches.


    [​IMG]

    Uploaded with ImageShack.us
     
  2. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    Have you used structures before?

    You can have for example:

    Sign(1).name = 'Aries';
    Sign(1).startDate = 'March 21';
    Sign(1).endDate = 'April 20';

    etc.

    Sign(2).name = 'Taurus';

    etc.
     
  3. Judas543

    Thread Starter Member

    Jan 26, 2010
    60
    0
    hmm yes i have, I was confused how the question wanted me to do it ?
     
  4. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    The question wants you to find how many perfect matches you have.
     
  5. Judas543

    Thread Starter Member

    Jan 26, 2010
    60
    0
    Where do i go after making the structures,

    what will be able to make it so the dates in the database will correspond to the structures I make and help me find the matches? I have ideas forming but it seems hopeless.

    *Also things I dont get...

    The astrological sign (women only) - Means women who have a certain sign only?

    The number of women with this astrological sign -Number of woman with this sign

    The astrological sign (men only) - sign for men only

    The number of women with this astrological sign -WHY THIS appear again?
     
  6. Judas543

    Thread Starter Member

    Jan 26, 2010
    60
    0
    i have no idea how to utilize those structures...

    I mean I have a new array which has the following format: The fifth column I added in which has [] at the end of each row

    Name | Gender | Month | Day | Sign


    So with those structures made that you suggested. I can't think of a way to implement it in a way so that when I enter it somehow... the women with gender F and particular date will be entered in the fifth column
     
  7. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    The structure I posted was just an example of structures, I don't know if that's a good format or not.

    To check for a match you just need to see how many couples you can make... it's a very simple check.

    #pairs = min( #men, #women)
    (per sign)

    So, with 0 and 0 you get 0.
    With 3 and 2 you get 2 pairs, etc.
     
Loading...