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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Cannot remove detail from worksheet

pleopard
1-Newbie

Cannot remove detail from worksheet

I've got a worksheet with an issue I don't understand. I have defined a set of sample indices using "i:=0..Nx-1" then build a spreadsheet using vectors with those indices. I wanted to see the array values when Nx=4 so I set the value and all was ok. When I go to remove the detail ... the [0,1,2,3] display that is ... the rest of the worksheet fails with a message "The value must be a scalar or a matrix". I know I'm being a bit vague but I don't really know how to better explain it so I have attached both good and bad versions of the file.

Any help would be appreciated

Thanks,

Paul

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:pleopard)

Paul Leopard wrote:

I appreciate your efforts and I see the worksheet you repaired is working just fine. When I compare it to my original that is not working I see no difference though.

There is a difference. As Werner mentioned, your 'Good sheet' worked because of a tricky, undocumented "feature". When you define a range and use inline evaluation like i:=0..3= , the range i is converted to a vector.

Clipboard01.jpg

Try deleting the inline definition and see what happens.

In Werners sheet he have defined XT using a vector index. Type XT[i and see what happens.

View solution in original post

8 REPLIES 8

When you define a vector using the range i you have to use the vector index (which you get by typing [) and not the literal index (which you get by typing Ctrl -)

It worked OK in your other sheet because of a tricky, undocumented "feature".

When you define a range and use inline evaluation like i:=0..3= , the range i is converted to a vector.

It didn't matter that you used the literal subscript, because you just did vector operations - the i in the name of your variables had nothing to do with the range/vector i but was just part of the variable name.

It works fine until I try to delete the element value display from the end

In the meantime I edited my above post and tried to explain that behaviour - its a bit tricky.

You may try it yourself. Just delete the index i in the names of your variables and you'll see that the sheet still is working OK.

Nevertheless I'd prefer the way I have shown in the sheet I posted.

I appreciate your efforts and I see the worksheet you repaired is working just fine. When I compare it to my original that is not working I see no difference though.

I guess I'm dense because I'm just not getting it ... If I "Just delete the index i in the names of your variables and you'll see that the sheet still is working OK" then it does work fine but for only one value, not for the vector range i.

I'll continue to examine this for a bit and see if I can figure out what you are doing. Any more tips would also be appreciated ... maybe the steps you took to repair the original?

Thanks,

Paul

MikeArmstrong
5-Regular Member
(To:pleopard)

Paul Leopard wrote:

I appreciate your efforts and I see the worksheet you repaired is working just fine. When I compare it to my original that is not working I see no difference though.

There is a difference. As Werner mentioned, your 'Good sheet' worked because of a tricky, undocumented "feature". When you define a range and use inline evaluation like i:=0..3= , the range i is converted to a vector.

Clipboard01.jpg

Try deleting the inline definition and see what happens.

In Werners sheet he have defined XT using a vector index. Type XT[i and see what happens.

MikeArmstrong
5-Regular Member
(To:pleopard)

Maybe reading through the documents posted here might help with you understand.

http://communities.ptc.com/docs/DOC-6073

Boom! Yes that works ... I get it now.

Thanks guys,

Paul

MikeArmstrong
5-Regular Member
(To:pleopard)

Super

Top Tags