Skip to main content
1-Visitor
Question

illegal context when range is multiplied

Hi,

Hope you guys can help.

I can print out the range multiplied by some value:

RTn9M.png

Why can't I store the resulting range in the variable?

18 replies

1-Visitor

Add tu as a subscript to tv by typing tv[tu.

Clipboard01.bmp

Translate
Werner_E
25-Diamond I

greg re wrote:

Hi,

Hope you guys can help.

I can print out the range multiplied by some value:

Why can't I store the resulting range in the variable?

Because a range is an implicit loop, not an a array of values. Use a vector instead of a range.

Translate
1-Visitor

Further to Werners suggestion, see below.

Clipboard01.bmp

I have used an undocumented feature to turn tu from a range to a vector by in-line evaluation.

Translate
23-Emerald I

Mike,

What version of Mathcad is that? My 15 M030 won't do that.

Translate
1-Visitor

Thanks for your answers, guys.

I am using subsript feature suggested by Mike Armstrong, but it still does not work:

math.PNG

LiL is still one thing that keeps formula from being computed.

Translate
1-Visitor

Please upload the worksheet again.

Translate
1-Visitor

math.PNG

Translate
1-Visitor

Not a picture ,the worksheet. You can do this by clicking 'use advanced editor'.

Translate
1-Visitor

Thanks for the tip.

Translate
1-Visitor

Have a look in the attached worksheet. There is a user defined function called vec which accepts ranges, range variables and converts them into a vector. Use this instead of using ranges.

Remember you may have to explicitly vectorize using this method.

Sorry am too busy to work through it at the moment.

Translate