Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15911
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Hi |
| Date | 2011-02-08 10:07 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <iir4k9$6nb$1@smc.vnet.net> (permalink) |
On 2/7/11 at 6:05 AM, isableng@gmail.com (Isabella Blengini) wrote:
>Hi I have a problem. I created a column vector of 100 rows, let's
>say a[100,1]. Each row corresponds to the value of my function in
>each unit of time. I would like to plot this vector. I should get a
>function that has a value a(1,1) at time 1, a(2,1) at time 2 and so
>on... Any suggestions???
To start, try actually creating what Mathematica recognizes as a
vector. Note
In[1]:= test = Array[a, 10]
Out[1]= {a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10]}
In[2]:= VectorQ[a]
Out[2]= False
In[3]:= VectorQ[test]
Out[3]= True
In Mathematica, the syntax a[100,1] is interpreted as the
function a evaluated with arguments 100 and 1. It is definitely
not a vector as the above demonstrates.
VectorQ[expr] returns true whenever expr is a one-dimensional
list. And when VectorQ[expr] is true, you can plot expr using
ListPlot. For example the following will plot the sin function
for one cycle
test = Sin[Range[100]*(Pi/50)];
ListPlot[test]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Hi Bill Rowe <readnews@sbcglobal.net> - 2011-02-08 10:07 +0000
csiph-web