Thread Subject: create n x n symbolic matrix in symbolic math toolbox?

Subject: create n x n symbolic matrix in symbolic math toolbox?

From: BHUPALA

Date: 4 Nov, 2009 09:22:02

Message: 1 of 2

Dear friends,

can you help me in creating n x n symbolic matrix like

       [a11 a12 ... a1n]
       [a21 a22 ... a2n]
A = [ ... ]
      [an1 an2 ... ann ]

Can anybody help me?

Regards.

Bhupala.

Subject: create n x n symbolic matrix in symbolic math toolbox?

From: Steven Lord

Date: 4 Nov, 2009 14:32:40

Message: 2 of 2


"BHUPALA" <bhupala@gmail.com> wrote in message
news:09744d62-04cb-4543-bb3a-95b45c87d0ac@x6g2000prc.googlegroups.com...
> Dear friends,
>
> can you help me in creating n x n symbolic matrix like
>
> [a11 a12 ... a1n]
> [a21 a22 ... a2n]
> A = [ ... ]
> [an1 an2 ... ann ]
>
> Can anybody help me?
>
> Regards.
>
> Bhupala.

A = sym(zeros(n, n));
for rows = 1:n
    for cols = 1:n
        A(rows, cols) = sym(sprintf('a%d%d', rows, cols));
    end
end

You should watch out if you want to create a moderately sized matrix like
this -- is a111 element (1, 11) of A or element (11, 1)? I would personally
use some separator between the row and column components of the sym variable
name.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com