cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Variable in Decleration

Highlighted

Variable in Decleration

This thread was created by a guest, but was created as a document so I have re-created it as a discussion to allow fellow collabs to contribute.

QUESTION


I am curious if there is a way to have a variable in a declaration. See the attached file for the example

My answer has been incorporated into the original worksheet, which shows the answer.

Mike

Tags (2)
6 REPLIES 6

Re: Variable in Decleration

Mike, thanks for taking the time.

One suggestion, use a program, see attached. Not exaclty what is asked for, but I think might be OK.

Re: Variable in Decleration

QUESTION


I am curious if there is a way to have a variable in a declaration. See the attached file for the example

When you definea variable with two subscripts you have created an array. In this case Table[1,5 creates an array two rows by six columns and inserts a 2 x 2 array in the last spot. Matncad fills the rest of the array with zeros.

Re: Variable in Decleration

Thank you all very much for your assistance. I suppose as I originally asked this as a "guest" there is no way for me to hand out stars now....The information provided is very helpful and I *think* i can make my sheet work now.


Thank you.

Re: Variable in Decleration

That is a good suggestion. I was a little concerned about posting the solution in my sheet as I knew is wasn't entirely correct, but it was the answer to the original question.

Have a look at the attached. A slightly different approach.

Cheers

Mike

Re: Variable in Decleration

When you definea variable with two subscripts you have created an array. In this case Table[1,5 creates an array two rows by six columns and inserts a 2 x 2 array in the last spot. Matncad fills the rest of the array with zeros.

Cheers for the response Fred.

I know that when a variable is defined with two subscripts a Matrix is created. The solution I posted was not the best, but was an answer to the original question.

As long as Table was evaluated using two subscripts there wouldn't have been an issue.

Mike

Re: Variable in Decleration

Thank you all very much for your assistance. I suppose as I originally asked this as a "guest" there is no way for me to hand out stars now....The information provided is very helpful and I *think* i can make my sheet work now.

Firstly welcome to the forum.

Do not worry about handing out stars the main thing is that you got your answer.

Mike