turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: print iteration output into one single matrix

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Dec 25, 2013 8:25 AM
(1318 views)

Hi,

How do I get the iteration output into one single matrix with format 3-columns and n-rows? The column1 , column2 and column3 are filled with x(i), y(i), z(i) respectively.

n = 6;

x_i = J (1,n);

y_i = J (1,n);

z_i = J (1,n);

For(i = 0, i <=n , i++,

x_i* = 38 + (i*5.0);*

y_i* = 45 + 3*(x_i) ;*

z_i* = 80 + 10*(x_i) ;*

);

mymatrix = [x_i , y_i, z_i];

print (mymatrix);

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Dec 25, 2013 11:13 AM
(2364 views)

Solution

This should work:

n = **6**;

x_i = J**(** **1**, n **)**;

y_i = J**(** **1**, n **)**;

z_i = J**(** **1**, n **)**;

For**(** i = **1**, i <= n, i++,

x_i**[**i**]** = **38** + **(**i * **5.0****)**;

y_i**[**i**]** = **45** + **3** * **(**x_i**)[**i**]**;

z_i**[**i**]** = **80** + **10** * **(**x_i**)[**i**]**;

**)**;

mymatrix = Transpose**(** x_i |/ y_i |/ z_i **)**;

Print**(** mymatrix **)**;

2 REPLIES

Highlighted
Solution

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Dec 25, 2013 11:13 AM
(2365 views)

This should work:

n = **6**;

x_i = J**(** **1**, n **)**;

y_i = J**(** **1**, n **)**;

z_i = J**(** **1**, n **)**;

For**(** i = **1**, i <= n, i++,

x_i**[**i**]** = **38** + **(**i * **5.0****)**;

y_i**[**i**]** = **45** + **3** * **(**x_i**)[**i**]**;

z_i**[**i**]** = **80** + **10** * **(**x_i**)[**i**]**;

**)**;

mymatrix = Transpose**(** x_i |/ y_i |/ z_i **)**;

Print**(** mymatrix **)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Dec 25, 2013 5:17 PM
(1182 views)