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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Display the index value

SFares
12-Amethyst

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
Werner_E
24-Ruby V
(To:SFares)

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

1.png

You can also make it look like this

2.png

View solution in original post

9 REPLIES 9
RichardJ
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.

SFares
12-Amethyst
(To:RichardJ)

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

Werner_E
24-Ruby V
(To:SFares)

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

1.png

You can also make it look like this

2.png

SFares
12-Amethyst
(To:Werner_E)

Thank you Werner!

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

SFares
12-Amethyst
(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!

Werner_E
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).

1.png

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.

2.png

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

3.png

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!

4.png

SFares
12-Amethyst
(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!

Werner_E
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).

Top Tags