TransWikia.com

Performing mathematical operation on the y coordinates in a list of coordinates

Mathematica Asked by Anon77 on December 14, 2020

I have a list that contains a set of coordinates in the form {{x1,y1}, {x2,y2}, …}. I want to edit the list in manner that it takes the log() of all the y coordinates only. Essentially, I want redefine the list such that it now contains {{x1,log(y1)}, {x2,log(y2)}, …}.

One Answer

{{x1, y1}, {x2, y2}, {x3, y3}} /. {x_, y_} :> {x, Log[y]}

Or

{#1, Log[#2]} & @@@ {{x1, y1}, {x2, y2}, {x3, y3}}

Or the method which provided by @wuyudi

Answered by cvgmt on December 14, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP