Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Linear equation Systems

Subject: Linear equation Systems

From: fatih

Date: 23 May, 2013 10:10:11

Message: 1 of 4

I have this question
how can I write this column vector?
x=[x(1)]
    [x(2)]
thanks

Subject: Linear equation Systems

From: Nasser M. Abbasi

Date: 23 May, 2013 11:59:03

Message: 2 of 4

On 5/23/2013 5:10 AM, fatih wrote:
> I have this question
> how can I write this column vector?
> x=[x(1)]
> [x(2)]
> thanks
>


Not sure what you are trying to since you did not say.

But may be you are looking for symbolic vector?

EDU>> x = sym('x', [2 1])
  
x =
  x1
  x2
  
EDU>> x(1)
x1
  
EDU>> x(2)
x2


--Nasser

Subject: Linear equation Systems

From: fatih

Date: 23 May, 2013 12:16:11

Message: 3 of 4

"Nasser M. Abbasi" wrote in message <knl0a5$ptv$1@speranza.aioe.org>...
> On 5/23/2013 5:10 AM, fatih wrote:
> > I have this question
> > how can I write this column vector?
> > x=[x(1)]
> > [x(2)]
> > thanks
> >
>
>
> Not sure what you are trying to since you did not say.
>
> But may be you are looking for symbolic vector?
>
> EDU>> x = sym('x', [2 1])
>
> x =
> x1
> x2
>
> EDU>> x(1)
> x1
>
> EDU>> x(2)
> x2
>
>
> --Nasser

if I write
for i=1:5
x1
x2
x3
x4
x5
How can I take it?

Subject: Linear equation Systems

From: Steven_Lord

Date: 23 May, 2013 14:25:21

Message: 4 of 4



"fatih " <mfatihk34@gmail.com> wrote in message
news:knl1aa$a5$1@newscl01ah.mathworks.com...
> "Nasser M. Abbasi" wrote in message <knl0a5$ptv$1@speranza.aioe.org>...
>> On 5/23/2013 5:10 AM, fatih wrote:

*snip*

> if I write for i=1:5
> x1
> x2
> x3
> x4
> x5 How can I take it?

Are you trying to create those variables inside your loop? If so, DON'T DO
THIS. See question 1 in the Programming section of the newsgroup FAQ for an
explanation why this is discouraged and alternatives.

http://matlab.wikia.com/wiki/FAQ

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

No tags are associated with this thread.

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.

Contact us