# Varying constant in Matrix algebra to generate 3D plot

**URL:** <https://community.wolfram.com/t/varying-constant-in-matrix-algebra-to-generate-3d-plot/7947>\
**Category:** Questions\
**Tags:** algebra, graphics-and-visualization\
**Created:** [February 20, 2016, 12:54pm UTC](https://community.wolfram.com/t/varying-constant-in-matrix-algebra-to-generate-3d-plot/7947 "2016-02-20T12:54:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swyang](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@swyang](https://community.wolfram.com/u/swyang)\
**Post date:** [February 20, 2016, 12:54pm UTC](https://community.wolfram.com/t/varying-constant-in-matrix-algebra-to-generate-3d-plot/7947/1 "2016-02-20T12:54:28Z")

</div>

I do have matrix where two constants are used in the middle of process. I’d like to generate 3D plot where x,y,z (= a,b,answer) while I am varying a (0\<a\<1) and b (0\<b\<1). Any help will be very appreciable.

```
a = 0.2(*constants*);
b = 0.5(*constants*);
matrix = RandomReal[{-1, 1}, {4, 2}];
matrix1 = matrix[[All, 1]];
matrix2 = matrix[[All, 2]];
inter1 = a/b matrix1;
inter2 = 1/b matrix2;
inter = inter1 + inter2;
answer = Total[inter]

```
