+ Reply to Thread
Results 1 to 6 of 6

Is there an object similar to Matlab vectors/matricies/cells?

  1. #1
    A C
    Guest

    Is there an object similar to Matlab vectors/matricies/cells?

    Hello

    I am after a vector/matrix/cell style object like there is in Matlab whereby
    we can read data into this matrix and maipulate it. All the sizing etc is
    automatically accounted for by the object itself when the data is assigned
    to the object, and its easy to do things like pull out columns 1-->5, count
    etc etc.

    Converting from an existing Matlab program and Matlab has lots of nice
    features for manipulating cells/vectors/matricies which I would love to have
    avaiable.

    Contents is not just numbers so its not a math vector etc I am after. For
    example it might read in a table of data where some fields are text and some
    are numbers. Basic manipulation, for example append, combine, remove these
    cols, remove these rows, sort, remove repeats, unique etc etc.

    Regards
    A



  2. #2
    Nick Hebb
    Guest

    Re: Is there an object similar to Matlab vectors/matricies/cells?

    The only thing like Matlab in Excel is Matlab itself. That is,
    Mathworks sells an Excel add-in that uses Matlab for all the
    computations. I think its pretty spendy though.

    Really, the closest built-in object with the capabilities that you're
    describing is probably a worksheet. Excel has a few built-in matrix
    functions, but with nowhere near Matlab's capabilities. You'd have to
    code a lot of it yourself.


  3. #3
    Dana DeLouis
    Guest

    Re: Is there an object similar to Matlab vectors/matricies/cells?

    Hi. Excel can't do these operations as well as a dedicated math program.
    If you would like, here are some ideas that may help a little. Good luck.
    :>)

    > ... things like pull out columns 1-->5, count
    > etc etc.


    Sub Demo()
    Dim v, c
    Const All As Long = 0

    '// 2 Dim array from A1:C5
    v = [A1:C5]

    With WorksheetFunction
    '// Extract all rows in the 2nd Column...
    c = .Transpose(.Index(v, All, 2))

    '// How many elements?
    Debug.Print "Number of items:";
    Debug.Print (UBound(v, 1) - LBound(v, 1) + 1) * (UBound(v, 2) -
    LBound(v, 2) + 1)

    '// Simulate "AppendTo"
    '// Add a new row (simulate adding a new list item)
    v = .Transpose(v)
    ReDim Preserve v(1 To UBound(v, 1), 1 To UBound(v, 2) + 1)
    v = .Transpose(v)
    v(UBound(v, 1), 1) = "a"
    v(UBound(v, 1), 2) = "new"
    v(UBound(v, 1), 3) = "row"
    End With

    End Sub

    HTH:
    --
    Dana DeLouis
    Win XP & Office 2003


    "A C" <[email protected]> wrote in message
    news:[email protected]...
    > Hello
    >
    > I am after a vector/matrix/cell style object like there is in Matlab
    > whereby
    > we can read data into this matrix and maipulate it. All the sizing etc is
    > automatically accounted for by the object itself when the data is assigned
    > to the object, and its easy to do things like pull out columns 1-->5,
    > count
    > etc etc.
    >
    > Converting from an existing Matlab program and Matlab has lots of nice
    > features for manipulating cells/vectors/matricies which I would love to
    > have
    > avaiable.
    >
    > Contents is not just numbers so its not a math vector etc I am after. For
    > example it might read in a table of data where some fields are text and
    > some
    > are numbers. Basic manipulation, for example append, combine, remove
    > these
    > cols, remove these rows, sort, remove repeats, unique etc etc.
    >
    > Regards
    > A
    >
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: Is there an object similar to Matlab vectors/matricies/cells?

    In excel, that would be a spreadsheet.

    --
    Regards,
    Tom Ogilvy


    "A C" <[email protected]> wrote in message
    news:[email protected]...
    > Hello
    >
    > I am after a vector/matrix/cell style object like there is in Matlab

    whereby
    > we can read data into this matrix and maipulate it. All the sizing etc is
    > automatically accounted for by the object itself when the data is assigned
    > to the object, and its easy to do things like pull out columns 1-->5,

    count
    > etc etc.
    >
    > Converting from an existing Matlab program and Matlab has lots of nice
    > features for manipulating cells/vectors/matricies which I would love to

    have
    > avaiable.
    >
    > Contents is not just numbers so its not a math vector etc I am after. For
    > example it might read in a table of data where some fields are text and

    some
    > are numbers. Basic manipulation, for example append, combine, remove

    these
    > cols, remove these rows, sort, remove repeats, unique etc etc.
    >
    > Regards
    > A
    >
    >




  5. #5
    Alan Beban
    Guest

    Re: Is there an object similar to Matlab vectors/matricies/cells?

    A C wrote:
    > Hello
    >
    > I am after a vector/matrix/cell style object like there is in Matlab whereby
    > we can read data into this matrix and maipulate it. All the sizing etc is
    > automatically accounted for by the object itself when the data is assigned
    > to the object, and its easy to do things like pull out columns 1-->5, count
    > etc etc.
    >
    > Converting from an existing Matlab program and Matlab has lots of nice
    > features for manipulating cells/vectors/matricies which I would love to have
    > avaiable.
    >
    > Contents is not just numbers so its not a math vector etc I am after. For
    > example it might read in a table of data where some fields are text and some
    > are numbers. Basic manipulation, for example append, combine, remove these
    > cols, remove these rows, sort, remove repeats, unique etc etc.
    >
    > Regards
    > A
    >
    >

    You might want to review the freely downloadable file at
    http:/home.pacbell.net/beban to see whether any of the functions might
    be helpful.

    Alan Beban

  6. #6
    A C
    Guest

    Re: Is there an object similar to Matlab vectors/matricies/cells?

    Thanks. Do you have an examples/demos of it working (programming skills not
    great yet) so I can see how you declared things and how you called them.
    Can it handle data that has multiple types? eg strings in some cells and
    numbers in others all within the same range? That said maybe I can just
    assume they are all strings, im not really wanting to do any calcs with the
    contents just reformatting and outputting etc.

    Regards
    A

    "Alan Beban" <[email protected]> wrote in message
    news:[email protected]...
    > A C wrote:
    > > Hello
    > >
    > > I am after a vector/matrix/cell style object like there is in Matlab

    whereby
    > > we can read data into this matrix and maipulate it. All the sizing etc

    is
    > > automatically accounted for by the object itself when the data is

    assigned
    > > to the object, and its easy to do things like pull out columns 1-->5,

    count
    > > etc etc.
    > >
    > > Converting from an existing Matlab program and Matlab has lots of nice
    > > features for manipulating cells/vectors/matricies which I would love to

    have
    > > avaiable.
    > >
    > > Contents is not just numbers so its not a math vector etc I am after.

    For
    > > example it might read in a table of data where some fields are text and

    some
    > > are numbers. Basic manipulation, for example append, combine, remove

    these
    > > cols, remove these rows, sort, remove repeats, unique etc etc.
    > >
    > > Regards
    > > A
    > >
    > >

    > You might want to review the freely downloadable file at
    > http:/home.pacbell.net/beban to see whether any of the functions might
    > be helpful.
    >
    > Alan Beban




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1