0% found this document useful (0 votes)
266 views

Resizing A Matrix - Vector

This document discusses options for resizing matrices and vectors in Mathcad. It begins with a question about resizing a 1x9 vector to 1x6 or 1x12. Responses provide the following methods: - Using submatrix to extract portions and resize vectors and matrices. - Mathcad variables are actually named constants, so defining a new variable of the desired size effectively resizes it. - Functions like stack, append, and augment can be used to add or join elements to resize matrices vertically or horizontally. - Deleting rows or columns is another option for resizing smaller, though defining a new matrix is often simpler.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
266 views

Resizing A Matrix - Vector

This document discusses options for resizing matrices and vectors in Mathcad. It begins with a question about resizing a 1x9 vector to 1x6 or 1x12. Responses provide the following methods: - Using submatrix to extract portions and resize vectors and matrices. - Mathcad variables are actually named constants, so defining a new variable of the desired size effectively resizes it. - Functions like stack, append, and augment can be used to add or join elements to resize matrices vertically or horizontally. - Deleting rows or columns is another option for resizing smaller, though defining a new matrix is often simpler.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Login / Register

Pgina 1 de 15

Support

Press Room

Blog

United Kingdom

Tel: +44 (0) 203 695 7810

Search Adept Scientific

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

[mathcad] resizing a matrix/vector


Search email archive for

Search

Blog
[mathcad] resizing a matrix/vector

Events

Author: Tom Boni

Posted: Fri, 5 Sep 2008 12:10:31 -0700 (

Jobs

Technical and
Customer Support

7810
for general enquiries

What options are there for resizing a matrix/vector?

+44 (0) 203 695

For instance lets say I have a 1 x 9 vector and want to make it 1 x 6 or 1 x 12?

for technical support

Our Customers

Press Room

so call us on

+44 (0) 203 695

Contact Us

Our Suppliers

We're here to help

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

--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?

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 2 de 15

Product Brochures

--Simply leave the mailing list (see below) and re-join by


Case Studies
Follow us
Training
About
EU ePrivacy Directive
+44 (0) 203 695 7810sending a blank email from the new
address to:
Adept
Products
For the
time
being
we are unable to offer the following product ranges although we are currently working hard to increase the number of products we can offer in the future.
General
Enquiries
Events
Contact Us
Terms and Conditions
Discussion Lists
or
Please contact
us to talk about alternative
products that we may be able
to offerApplications
you.
Bibliography
Software
Maths
Laboratory
Data Acquisition
Graphics & GUI Tools
--- and Simulation
Press Room
Jobs
Privacy Policy
EndNote
EndNote
Mathcad
GRAMS/AI
DASYLab
You are currently subscribed to mathcad as: /> To unsubscribe send a blank email to />
Electronics
Design
Reference
Manager
Mathcad
Mon-Fri 10:00-17:00
Multisim
Qualitative
Procite Analysis
NVivo
Reference Manager

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

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 3 de 15

Philip
-----Original Message----From: Tom Boni /> Sent: 05 September 2008 8:11 PM
To: /> Subject: [mathcad] resizing a matrix/vector

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
List Archive: http://lists.adeptscience.co.uk/
---

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 4 de 15

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
Attachments:
reorder a vector.mcd
reorder a vector.xmcdz

Re: [mathcad] resizing a matrix/vector

Author: Radovan Omorjan

Posted: Sat, 06 Sep 2008 21:22:12 -0700

Look at the attached file (Mcad v.11)


For manipulating matrices you can use
submatrix - extracting a submatrix from a matrix
append - joining matrices horizontally (must have the same number of rows)
stack - joining matrices vertically (must have the same number of columns)
> 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/

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 5 de 15

--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
Attachments:
rowmatrix.mcd

Re: [mathcad] resizing a matrix/vector

Author: =?ISO-8859-1?Q?Steen_Gro=F0e?=

Posted: Sat, 06 Sep 2008 13:33:11 +0200

> 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...
Sizing up is just adding the new elements.
Sizing down is slightly more difficult. You can use submatrix for that.
Med venlig hilsen
:-) Steen Groe
http://www.grode.dk

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 6 de 15

--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 />
Re: [mathcad] resizing a matrix/vector

Author: David G Shaw

Posted: Sun, 07 Sep 2008 00:04:58 +0000

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. "

Hope these might help.


Regards,
David Shaw
-------------- Original message from Tom Boni --------------

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 7 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: unsubscribe send a blank email to
> /> --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
Re: [mathcad] resizing a matrix/vector

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Author: Radovan Omorjan

Pgina 8 de 15

Posted: Sat, 06 Sep 2008 21:27:22 -0700

Forgot to attach the file, sorry


> 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
Attachments:
rowmatrix.mcd

RE: [mathcad] resizing a matrix/vector

Author: Stuart Bruff

Posted: Sat, 6 Sep 2008 15:51:56 +0100

Tom,

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

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)

-----Original Message----From: Tom Boni


Sent: 05 September 2008 8:11 PM
To: /> Subject: [mathcad] resizing a matrix/vector

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

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 10 de 15

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
/>
-This message has been scanned for viruses and
dangerous content by Houxou, and is
believed to be clean.

--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
Attachments:
collab - matrix expansion 01.mcd

Re: [mathcad] resizing a matrix/vector

Author: Tom Boni

Posted: Mon, 8 Sep 2008 15:11:52 -0700 (

This is a technique that I will have use for.


Thanks!

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 11 de 15

--- On Sun, 9/7/08, Radovan Omorjan wrote:


> From: Radovan Omorjan />> Subject: Re: [mathcad] resizing a matrix/vector
> To: />> Date: Sunday, September 7, 2008, 8:27 AM
> Forgot to attach the file, sorry
>
> > 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

http://lists.adeptscience.co.uk/mathcad/mathcad_Sep_2008/thid_399df5973c526dff68d91edde4e7e5fc/si_0.html

16-11-2016

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 12 de 15

> />

--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 />
RE: [mathcad] resizing a matrix/vector

Author: Tom Boni

Posted: Mon, 8 Sep 2008 15:21:18 -0700 (

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

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 13 de 15

> a page between


> the point it is defined and the point that another of the
> same name is
> defined.
>
> The only 'unless' is that within a programme (with
> the black bar and the
> left pointing arrows) those variables are true variables
> that can be
> overwritten and are thrown away at the end of the
> execution.
>
> 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.
> 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

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

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

Mathcad List Archive - [mathcad] resizing a matrix/vector - Adept Scientific

Pgina 15 de 15

> 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
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 />
Previous by date: Re: [mathcad] Contouring irregular data, Tom Gutman
Next by date: [mathcad] getting plot data, Tom Boni
Previous thread: [mathcad] Contouring irregular data, Rob Beale
Next thread: [mathcad] getting plot data, Tom Boni

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy