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

11-Garnet

## Display the index value

Hello,

In the attached sheet, please scroll down to the red arrow. is there a way you can display the index value for "W". Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:SFares)

Maybe using "explicit" does what you want. n must not defined a value to make it work.

You can also make it look like this

9 REPLIES 9
19-Tanzanite
(To:SFares)

What do you mean by "the index for each W based on the n value?" The index is either n-2, n-1, n, n+1, or n+2.

11-Garnet
(To:RichardJ)

for example to display when n=3, to plug in that value and get or display W1,W2,W3,W4,,W5 .

24-Ruby V
(To:SFares)

Maybe using "explicit" does what you want. n must not defined a value to make it work.

You can also make it look like this

11-Garnet
(To:Werner_E)

Thank you Werner!

every time i use subsitute, do i need to use explicit with it?

11-Garnet
(To:SFares)

Werner,

why doesn't it work if i define a value for as i did earlier, and then use explicit, n w/o subsitute? just trying to understand how things work!

24-Ruby V
(To:SFares)
 why doesn't it work if i define a value for as i did earlier, and then use explicit, n w/o subsitute?

Mathcad's explicit command has its quirks and acts a bit strange when it comes to matrix indices.

When you defie n in your worksheet, a simple explicit,n without any substitution should do the job like in the first example below, nut as you can see yoz get a strange result when used for a vector index which is calculated (n+1).

It works OK, if you substitute the very same value you also have defined in your worksheet. But if you mistakenly substitute a different value you run into troubles. Index n gets the value you substitute, but calculated indices like n+1 use the worksheet variable.

One way to cope with this is to use the (silly looking) substitution n=n.

24-Ruby V
(To:Werner_E)

Couldn't add a pic anymore to the above post:

Just found out that it works OK even without substitute as long as explicit is not the only command in the symbolic evaluation - crazy!

11-Garnet
(To:Werner_E)

i like your suggestion to set n=n. this way i dont to go to each term in the equation and define n. so i can define n on the outside. Thanks Werner!

24-Ruby V
(To:SFares)
 sameer fares wrote:i like your suggestion to set n=n. this way i dont to go to each term in the equation and define n. so i can define n on the outside. Thanks Werner!

You may also add anything else to the symbolic eval. It doesn't matter what command as long as explicit is not the only one (see above).

Announcements