Skip to main content
1-Visitor
Oct 24, 2014 9:19 AM UTC
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
Oct 24, 2014 9:22 AM UTC

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

Clipboard01.bmp

Translate
Werner_E
25-Diamond I
Oct 24, 2014 10:04 AM UTC

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
Oct 24, 2014 10:13 AM UTC

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
Oct 24, 2014 2:01 PM UTC

Mike,

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

Translate
1-Visitor
Oct 31, 2014 1:33 PM UTC

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
Oct 31, 2014 1:35 PM UTC

Please upload the worksheet again.

Translate
1-Visitor
Oct 31, 2014 1:37 PM UTC

math.PNG

Translate
1-Visitor
Oct 31, 2014 1:49 PM UTC

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

Translate
1-Visitor
Oct 31, 2014 1:51 PM UTC

Thanks for the tip.

Translate
1-Visitor
Oct 31, 2014 1:58 PM UTC

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