Resizing A Matrix - Vector
Resizing A Matrix - Vector
Login / Register
Pgina 1 de 15
Support
Press Room
Blog
United Kingdom
Products
Training
Solutions
Support
Store
About
Home List Archives Mathcad List Archive Archive by date This Month By Date This Month By Topic
About Us
About Us
Search
Blog
[mathcad] resizing a matrix/vector
Events
Jobs
Technical and
Customer Support
7810
for general enquiries
For instance lets say I have a 1 x 9 vector and want to make it 1 x 6 or 1 x 12?
Our Customers
Press Room
so call us on
Contact Us
Our Suppliers
7810
Right now, I just create a new (empty) vector of the desired size...
Just thought I'd ask in case there is an "on-the-fly" method that I am not aware of...
UK office:
Monday - Thursday
09:00 - 17:30
Friday 09:00 - 17:00
Services
RSS News Feeds
In many cases the elements of the new vector are the same as elements in the existing
vector...
Consultancy
Training
Tech Support
Downloads
Demos
Patches and Updates
Add-ons/Plug-ins
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 2 de 15
Product Brochures
Fortran Compilers
International
Absoft for Linux
Absoft
for Mac
OS X
United
Kingdom
Absoft for Windows
Germany
Intel Fortran Compilers
Denmark
Portland
PGI
Silverfrost
FTN95
Sweden
Data
Acquisition
Laboratory
Applications
Maths and Simulation
MathType
Kinetica
C/C++
Compilers
ADwin
ChemBio3D
Micro Saint
VisSim
Intel
Product
Suites
Intel
C++
Compilers
RE:
[mathcad]
resizing
a
matrix/vector
Delphin Workplace / Scientific
ChemBioDraw
Scientific
Qualitative Analysis
Intel
Parallel
Studio
XE
Measurement
Computing
ChemBioOffice
Notebook
/ Scientific
Word
MVSP
Author: Philip Oakley Posted:Intel
Sat,System
6 Sep Studio
2008 12:36:01 +0100 Libraries
WinWedge
ChemDraw
Intel
Integrated Performance
ProSuite
Fortran Tools
Primitives
DataTom,
Visualisation
QDA Miner(IPP)
Forcheck
Intel
Math Kernel Library (MKL)
DADiSP with SPAG
SimStat
plusFort
Intel
MPI Library
Origin
WordStat
The hidden feature of MathCAD is that in reality it doesn't have any
Fortran
and
C++
Tools
Intel
Threading Building Blocks
variables. It has named constants that exist for a part of a page between
Intelthe
Inspector
XE
Rogue
point it is defined and the point that another of the same name is Wave IMSL
Inteldefined.
VTune Amplifier XE
Editors
NWA Focus EMI
UltraEdit
Quality Analyst
Quality Analyst Webserver
Quality Information System
SPC (Embedded)
Finland
Norway
So if you define
v:=stack(1,2,3,4,5,6,7,8,9)
then
v:submatrix(v,2,7,0,0)
you now have two variables 'v' (both vectors) on the page and if you type
"v=" and then drag it around, you will see the two results depending on
where the "v=" is on the page.
Also, if you have a set of indices 'index' to be used to pull out and
re-order it you can use. you can even convert it to a little programme if
needed.
i:=0;..last(index)
v[i]:=v[(index[i])]
will also do it (I have closed the [] brackets subscripts, shown :=, and the
range ;..
Hope that helps.
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 3 de 15
Philip
-----Original Message----From: Tom Boni /> Sent: 05 September 2008 8:11 PM
To: /> Subject: [mathcad] resizing a matrix/vector
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 4 de 15
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 5 de 15
Author: =?ISO-8859-1?Q?Steen_Gro=F0e?=
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 6 de 15
Hi Tom,
I have used the functions stack() and augment() from time to time.
stack(,,,,) adds elements, vectors or matrices to the vertical structure of a vector or matrix.
I use stack often to expand an arbitrary vector to get nice round numbers (2^N) for FFTs.
augment(,,,,) adds columns together to widen a matrix or lengthen a transposed vector.
Don't know the equivalent for reducing matrices. You can always delete rows or columns
though.
Help shows:
"
Deleting RowsThis procedure deletes the row containing the selected element together
with an appropriate number of rows below it. "
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 7 de 15
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 8 de 15
Tom,
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 9 de 15
If you want to expand an array, simply set the values you want for the new
elements. A standard way of creating a vector is to set the largest index
to 0, which returns a vector of all zeros; for many applications this
improves execution speed as Mathcad only has to create the array once,
rather than having to keep bolting new elements on (which can be
time-consuming, particularly for large arrays).
To shrink an array, use the submatrix function, eg if v is your 9-element
vector, then submatrix(v,0,5,0,0) will return a 6-element vector comprising
the first six elements of v
Stuart
Calling convention: submatrix(vector,first_row,last_row,first_col,last_col)
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 10 de 15
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 11 de 15
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 12 de 15
> />
Philip,
I think I understand your point.
Isn't this why one needs to be sure that they haven't accidentally redefined their "variables"
during the course of a calculation (?)
Although, couldn't one argue that the x in F(x) is a "true" variable?
Thanks again...
--- On Sat, 9/6/08, Philip Oakley wrote:
> From: Philip Oakley />> Subject: RE: [mathcad] resizing a matrix/vector
> To: />> Date: Saturday, September 6, 2008, 3:36 PM
> Tom,
>
> The hidden feature of MathCAD is that in reality it
> doesn't have any
> variables. It has named constants that exist for a part of
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 13 de 15
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 14 de 15
>
>
> What options are there for resizing a matrix/vector?
>
> For instance lets say I have a 1 x 9 vector and want to
> make it 1 x 6 or 1 x
> 12?
>
> Right now, I just create a new (empty) vector of the
> desired size...
>
> Just thought I'd ask in case there is an
> "on-the-fly" method that I am not
> aware of...
>
> In many cases the elements of the new vector are the same
> as elements in the
> existing vector...
>
>
>
>
> --> The Mathcad List - Discussion, Support & News
> Contributions: />> Hosted by: Adept Scientific
> http://www.adeptscience.com
> List Archive: http://lists.adeptscience.co.uk/
> --> Would you like this to come to a different email address?
> --> Simply leave the mailing list (see below) and re-join by
> sending a blank email from the new address to:
> or
> --> You are currently subscribed to mathcad as:
> />> To unsubscribe send a blank email to
> />>
> --> The Mathcad List - Discussion, Support & News
> Contributions: />> Hosted by: Adept Scientific
> http://www.adeptscience.com
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016
Pgina 15 de 15
2016 Alfasoft Limited trading as Adept Scientific. A.W. House, 6 - 8 Stuart Street, LU1 2SJ. LUTON
http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html
16-11-2016