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:
inputting a vector

Subject: inputting a vector

From: ali

Date: 10 Feb, 2009 19:15:03

Message: 1 of 6

I need to "input" a vector in matlab. Looking at the help for the "input" it seems possible to do it with a loop, however, is there a way to do it without using a loop?

Thanks,

Subject: inputting a vector

From: Eric Williams

Date: 10 Feb, 2009 19:19:01

Message: 2 of 6

"ali " <amkashef@gmail.com> wrote in message <gmsjnn$p36$1@fred.mathworks.com>...
> I need to "input" a vector in matlab. Looking at the help for the "input" it seems possible to do it with a loop, however, is there a way to do it without using a loop?
>
> Thanks,

What do you mean "input" a vector? Pass a vector as an input to a function? Read it in from a file? Where is the input, what is the destination? Of what type are the components of the vector, is it a vector or a matrix?

Subject: inputting a vector

From: someone

Date: 10 Feb, 2009 19:20:18

Message: 3 of 6

"ali " <amkashef@gmail.com> wrote in message <gmsjnn$p36$1@fred.mathworks.com>...
> I need to "input" a vector in matlab. Looking at the help for the "input" it seems possible to do it with a loop, however, is there a way to do it without using a loop?
>
> Thanks,

R = input('Input your vector:')
Input your vector:[1 2 3]

R =

     1 2 3

Subject: inputting a vector

From: Joerg Buchholz

Date: 10 Feb, 2009 19:21:01

Message: 4 of 6

"ali " <amkashef@gmail.com> wrote in message <gmsjnn$p36$1@fred.mathworks.com>...
> I need to "input" a vector in matlab. Looking at the help for the "input" it seems possible to do it with a loop, however, is there a way to do it without using a loop?
>
> Thanks,

r = input('blabla ')
blabla [1 2 3 4]

r =

     1 2 3 4

Subject: inputting a vector

From: NZTideMan

Date: 10 Feb, 2009 19:31:58

Message: 5 of 6

On Feb 11, 8:15=A0am, "ali " <amkas...@gmail.com> wrote:
> I need to "input" a vector in matlab. Looking at the help for the "input"=
 it seems possible to do it with a loop, however, is there a way to do it w=
ithout using a loop?
>
> Thanks,

"input" is unlikely to be the appropriate command for inputting your
vector, unless you plan to type the numbers in from the keyboard.
Go to Matlab help screen and look through "data".
There are numerous methods listed there.

BTW, you should learn to use Matlab help, rather than coming here for
such basic questions as this and your previous one. And only ask here
if you get stuck.

Subject: inputting a vector

From: ali

Date: 10 Feb, 2009 22:01:02

Message: 6 of 6

sure sir,

BTW, since you are good at this, could you help with this one:

I need to get rid of the loop in this, while making the same matrix:

for z = 1 : L
c (:, z) = A(z) : t : A(z)+t*B;
end


thanks a lot.

> On Feb 11, 8:15=A0am, "ali " <amkas...@gmail.com> wrote:
> > I need to "input" a vector in matlab. Looking at the help for the "input"=
> it seems possible to do it with a loop, however, is there a way to do it w=
> ithout using a loop?
> >
> > Thanks,
>
> "input" is unlikely to be the appropriate command for inputting your
> vector, unless you plan to type the numbers in from the keyboard.
> Go to Matlab help screen and look through "data".
> There are numerous methods listed there.
>
> BTW, you should learn to use Matlab help, rather than coming here for
> such basic questions as this and your previous one. And only ask here
> if you get stuck.
>

Tags for 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