haveahapyday Posted November 13, 2018 Share Posted November 13, 2018 (edited) correct me if i shouldn't be doing things this way, but basically in a wrangle sop rather than creating a bunch of separate control channels, i want to make one matrix3 and then access the individual components. here's a couple ways i've tried: matrix3 testMatrix = ch3("testMatrix"); f@testValA = testMatrix[0][0]; f@testValB = getcomp(testMatrix, 0, 0); f@testValC = testMatrix[0:0]; i apologize if this is beyond n00b, but i've tried over an hour to figure this out and got no where. thanks! Edited November 13, 2018 by haveahapyday fixed code example Quote Link to comment Share on other sites More sharing options...
3dome Posted November 13, 2018 Share Posted November 13, 2018 (edited) well your matrix is called testMatrix but you ask for indices or getcomp() of something called limits getcomp() works just fine and from the docs "The square-brackets operator also works on vectors. You can use it with matrices as well using a pair of brackets: float a = m3[0][1];" (couldnt make it work in 16.5, maybe new feature in 17) Edited November 13, 2018 by 3dome Quote Link to comment Share on other sites More sharing options...
haveahapyday Posted November 13, 2018 Author Share Posted November 13, 2018 7 hours ago, 3dome said: well your matrix is called testMatrix but you ask for indices or getcomp() of something called limits whoops, was confusing the example i wrote up with what i was actually using. edited the original post to make the example accurate. 7 hours ago, 3dome said: getcomp() works just fine and from the docs "The square-brackets operator also works on vectors. You can use it with matrices as well using a pair of brackets: float a = m3[0][1];" (couldnt make it work in 16.5, maybe new feature in 17) i was using H16 at home when i was trying that so maybe that could be the issue? getcomp() works in V17, but float testValA = testMatrix[0][0]; throws this error: "Call to undefined array index operator 'matrix3[int]', returning one of vector4, vector2, vector, float[], int[], vector4[] or vector[]." Quote Link to comment Share on other sites More sharing options...
3dome Posted November 13, 2018 Share Posted November 13, 2018 getcomp() should work in H16 too. Don't have it anymore so I can't test. Yes, I get that error in 16.5 too. Submit a RFE if you want. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.