Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to use ones(A)?

  • To: mathgroup at
  • Subject: [mg88248] Re: how to use ones(A)?
  • From: Bill Rowe <readnews at>
  • Date: Tue, 29 Apr 2008 06:51:23 -0400 (EDT)

On 4/28/08 at 4:40 AM, second_444 at (second_444) wrote:

>v=[1 2 3];a=ones(v) the result is: a(:,:,1) =

Nonsense as should be expected when you don't use appropriate syntax.

If you type

v=[1 2 3]

into a new cell and execute it you will get an error.

This syntax tells Mathematica to compute the product of 1, 2 and
3 then evaluate a function with no name with an argument equal
to 6.

I am guessing you want

v= {1,2,3

rather than what you wrote.

Now after using a correct assignment the syntax you use to get a
result isn't meaningful either. The characters "(" and ")" are
used for grouping. The syntax a(stuff) tells Mathematica to
multiply the stuff between "(" and ")" by a. I doubt this is
what you wanted.

v[x] is a function v to be evaluated at x
v[[x]] says return the item x from list v
v(x) says multiply x by v
v{x} says multiply the list with one element x by v and will
return {x v}

  • Prev by Date: Re: Transforming a polynomial into a trigonometric format tia sal2
  • Next by Date: Re: Re: Wolfram User Interface Research?
  • Previous by thread: Re: how to use ones(A)?
  • Next by thread: Transforming a polynomial into a trigonometric format tia sal2