<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Would something like this work?:</div><div>(matrix-map-rows</div><div> (lambda (row)</div><div> (matrix- row arr))</div><div> final-data-matrix)</div><div><br></div><div><a href="http://docs.racket-lang.org/math/matrix_poly.html?q=matrix%20row%20map#%28def._%28%28lib._math%2Fmatrix..rkt%29._matrix-map-rows%29%29">http://docs.racket-lang.org/math/matrix_poly.html?q=matrix%20row%20map#%28def._%28%28lib._math%2Fmatrix..rkt%29._matrix-map-rows%29%29</a></div><br><div><div>On Nov 28, 2014, at 4:56 PM, Animesh Pandey <<a href="mailto:animeshpandey.etno@gmail.com">animeshpandey.etno@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>(map </div><div> (λ(i) </div><div> (matrix- </div><div> (list->matrix 1 4 i) </div><div> (list->matrix 1 4 arr))) </div><div> final-data)</div><div><br></div><div>I used this method where final-data is a list of lists and I iterate through each list, convert it to a matrix and then subtract a pre-defined constant list to it. What I really need is a way to iterate through a matrix and not a list of lists as I have do to a lot of matrix operations.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 28, 2014 at 4:41 PM, Animesh Pandey <span dir="ltr"><<a href="mailto:animeshpandey.etno@gmail.com" target="_blank">animeshpandey.etno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>I have a 80 X 4 matrix. I have iterate through each row and subtract each row with another array at each iteration. At first I thought to convert all array to list and do all the operations and then again convert the final list if lists to a matrix. But I somehow think that is not a suited way. I tried using "for*/matrix" but could not get it right. Could any one give an example on how to iterate a matrix (array for arrays)?</div><div><br></div><div>My matrix looks like this:</div><div><div>> (list*->matrix final-data)</div><div>(array</div><div> #[#[5.1 3.5 1.4 0.2]</div><div> #[4.9 3.0 1.4 0.2]</div><div> #[4.7 3.2 1.3 0.2]</div><div> #[4.6 3.1 1.5 0.2]</div><div> #[5.0 3.6 1.4 0.2]</div><div> #[5.4 3.9 1.7 0.4]</div><div> #[4.6 3.4 1.4 0.3]</div><div> #[5.0 3.4 1.5 0.2]</div><div> #[4.4 2.9 1.4 0.2]</div><div> #[4.9 3.1 1.5 0.1]</div></div><div>...........</div><div><br></div><div>Thanks!</div></div>
</blockquote></div><br></div>
____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>