ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there an object similar to Matlab vectors/matricies/cells? (https://www.excelbanter.com/excel-programming/330492-there-object-similar-matlab-vectors-matricies-cells.html)

A C

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



Nick Hebb

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.


Dana DeLouis[_3_]

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" wrote in message
...
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





Tom Ogilvy

Is there an object similar to Matlab vectors/matricies/cells?
 
In excel, that would be a spreadsheet.

--
Regards,
Tom Ogilvy


"A C" wrote in message
...
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





Alan Beban[_2_]

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

A C

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" wrote in message
...
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





All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com