# create a vector with a variable as an element

0

Hi

I want to create a vector called "gss" with m but got the following:

```m=-ln(0.5/0.24212945-1);
gss={m,1};

m
-0.062985214

gss[1,1]
+DEN
```

Why is that gss[1,1] is not equal to m? Plus why can't I just do gss={m}?

Thanks for your help!

Laura

0

The reason that gss[1,1] is not equal to the value of m (-0.06298) is because GAUSS allows you to add character elements to matrices and vectors. So what you actually added to gss was the character element m. You can see this by printing it as a character element by prepending with the \$ like this:

```m=-ln(0.5/0.24212945-1);
gss={m,1};

print \$gss[1,1];
```

results in:

```   m
```

Depending upon what else is going on in the program you could do something like this:

```//the pipe operator '|' performs vertical concatenation
gss = -ln(0.5/0.24212945-1)|1;

//or this
gss = ones(2,1);
gss[1,1] = -ln(0.5/0.24212945-1);
```

Tags: asked July 31, 2013

0

The reason that gss[1,1] is not equal to the value of m (-0.06298) is because GAUSS allows you to add character elements to matrices and vectors. So what you actually added to gss was the character element m. You can see this by printing it as a character element by prepending with the \$ like this:

```m=-ln(0.5/0.24212945-1);
gss={m,1};

print \$gss[1,1];
```

results in:

```   m
```

Depending upon what else is going on in the program you could do something like this:

```//the pipe operator '|' performs vertical concatenation
gss = -ln(0.5/0.24212945-1)|1;

//or this
gss = ones(2,1);
gss[1,1] = -ln(0.5/0.24212945-1);
```

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

Ready to Get Started?

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!

• ### Where to Buy

Available across the globe, you can have access to GAUSS no matter where you are.