I'm confused. In your first message, you said that you are solving y=ax, and that you had data for y and for a, and that y's shape was 200 while a's shape was 200 49 (which would suggest that x has shape 49). And I thought you were asking for help in extracting the data from a textual format.
In this message you seem to say that you have x and y, and that you have the numbers and just need to figure out how to use them. Also, you seem to be suggesting that both x and y have a shape of 200 50, which would suggest that "a" has a shape of 200 200. Anyways, let's take the case described in the first message, where your data is a 200 50 matrix representing y = ax. Or, expressed in J, we want Y -: A +/ .* X The closest we can get to this would be: Y=: {."1 data A=: }."1 data X=: (%.A)+/ .*Y Except, of course, if we are working with completely random data (for example: data=: ?200 50$0), Y -: A +/ .* X will almost certainly not be valid (because we have 200 equations and only 49 unknowns and in the completely random case that leaves 51 more degrees of freedom than we can express). Still, we can get a least squares approximation... >From your description of the second case, the best I can come up with is: Y=: 50 {."1 DATA X=: 50 }."1 DATA A=: Y +/ .*%.X and if DATA=: ?200 100$0 the difference between Y and A +/ .* X should be reasonably small, so that almost makes sense... But, of course, these two concepts of X, Y and A are very different from each other. -- Raul On Sat, Sep 8, 2012 at 4:31 PM, pascha <amirpasha...@gmail.com> wrote: > The content of the text is numbers (x y positions). I trimmed all the > unnecessary characters (like , ( ) = etc.) and what I got is a 200 x 50 > matrix (or more precisely 200 x 100 because we have x and y). I managed to > get and solve the equation for the 2nd column but I need strategy for other > columns in a automatic way (i.e. in loop or without loop) > > Raul Miller-4 wrote: >> What does the text look like? >> >> -- >> Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm