Message Boards Message Boards

1
|
5518 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Creating a single col matrix

Posted 10 years ago

I'm looking for help to create an n*1 matrix having this condition v1,v2,v3 for i=1 to i=3, VRng for i=4 to i=n-4 v4,v5,v6 for i=n-3, to i=n

mean MatrixForm[v1,v2,v3,...VRng...,v4,v5,v6]

f[x_] = -x;
g[x_] = -(11 + 9 x + x^2 - x^3) E^x;
v1 = N[(-Subscript[a, 0] Subscript[A, 0] - 
     Subscript[c, 1] h Subscript[A, 1] - 
     h^4 (Subscript[v, 0] (g[0] - f[0] Subscript[A, 0]) + 
        Subscript[v, 1] g[1] + Subscript[v, 2] g[2] + 
        Subscript[v, 3] g[3] + Subscript[v, 4] g[4] + 
        Subscript[v, 5] g[5]))];
v2 = N[(-Subscript[c, 2] h Subscript[A, 1] - 
     h^4 (Subscript[w, 1] g[1] + Subscript[w, 2] g[2] + 
        Subscript[w, 3] g[3] + Subscript[w, 4] g[4] + 
        Subscript[w, 5] g[5] + Subscript[w, 6] g[6]))];
v3 = N[h^4 (\[Lambda] (g[0] - f[0] Subscript[A, 0]) + \[Mu] g[
         1] + \[Tau] g[2] + \[Nu] g[3] + \[Tau] g[4] + \[Mu] g[
         5] + \[Lambda] g[6]) - 6 \[Alpha] Subscript[A, 0]];
VRnge = N[
   h^4 (\[Lambda] g[1] + \[Mu] g[2] + \[Tau] g[3] + \[Nu] g[
        4] + \[Tau] g[5] + \[Mu] g[6] + \[Lambda] g[7])];
v4 = N[h^4 (\[Lambda] g[2] + \[Mu] g[3] + \[Tau] g[4] + \[Nu] g[
         5] + \[Mu] g[6] + \[Lambda] g[7]) + 
    h^4 \[Lambda] (g[8] - f[8] Subscript[B, 0])];
v5 = N[Subscript[c, 2] h Subscript[B, 1] - 
    h^4 (Subscript[w, n] - 6 g[2] + Subscript[w, n - 5] g[7] + 
       Subscript[w, n - 4] g[4] + Subscript[w, n - 3] g[5] + 
       Subscript[w, n - 2] g[6] + Subscript[w, n - 1] g[7])];
v6 = N[-Subscript[a, n] Subscript[B, 0] + 
    Subscript[c, 1] h Subscript[B, 1] - 
    h^4 Subscript[v, n] (g[8] - f[8] Subscript[B, 0]) - 
    h^4 (Subscript[v, n - 5] g[7] + Subscript[v, n - 4] g[4] + 
       Subscript[v, n - 3] g[5] + Subscript[v, n - 2] g[6] + 
       Subscript[v, n - 1] g[7])];

These are the values of V

I have tried this, but I'm stuck, could anyone please help me out?

Regards,

Vvals = {v1, v2, v3, VRnge, v4, v5, v6};
MatrixForm[Vvals]

VMat1 = {};
For[i = 1, i <= n, i++, VMat1 = Append[VMat1, Vvals]];
Attachments:
POSTED BY: Muzahoo jee

$\mathit{Mathematica}$ makes no difference between column and row vectors, column and row matrices; they all are just lists. There are no column lists and no row lists in $\mathit{Mathematica}$.

In[13]:= muzahooM[n_Integer] := {Join[{v1, v2, v3}, ConstantArray[vRng, n - 6], {v4, v5, v6}]} /; n > 5

In[14]:= muzahooM[6]
Out[14]= {{v1, v2, v3, v4, v5, v6}}

In[15]:= MatrixQ[muzahooM[6]]
Out[15]= True

In[16]:= TensorRank[muzahooM[6]]
Out[16]= 2

In[17]:= Dimensions[muzahooM[6]]
Out[17]= {1, 6}

In[18]:= muzahooM[17]
Out[18]= {{v1, v2, v3, vRng, vRng, vRng, vRng, vRng, vRng, vRng, vRng,vRng, vRng, vRng, v4, v5, v6}}

In[19]:= MatrixQ[muzahooM[17]]
Out[19]= True

In[20]:= TensorRank[muzahooM[17]]
Out[20]= 2

In[21]:= Dimensions[muzahooM[17]]
Out[21]= {1, 17}
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract