0
|
8286 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# How to join two simple parts programs

Posted 9 years ago
 I'm sure this question should be very simple but I really am just a beginner trying to learn. I am developing a program in two parts. One of this, calculates the centroid of the circular image. The centroid information is necessary calculates the total intensity of pixels in this circular image defined by a radius r disk. The problem is that the output of the centroid calculation provides x and y as follows {{x, y}}. This prevents the insertion of one part on the other. I need a type exit {x, y} or simply x, y ............................................................................................................ I really appreciate for any suggestion let me move on. Thanks, Antonio Attachments:
2 Replies
Sort By:
Posted 9 years ago
 Yes, your suggestions worked very well. Thank you.
Posted 9 years ago
 Hi Antonio,I downloaded your notebook, but I'm not entirely sure I understand the problem... Does one of these things help you? Also, please take a look at the Documentation for Part and Flatten for more examples. test = {{1, 2}} test[[1]] (*returns {1,2} *) test2 = {{1, 2}, {3, 4}} Flatten[test2] (*returns {1, 2, 3, 4} *) test3 = {{{1, 2}}, {{3, 4}}} Flatten[test3, 1] test3[[All, 1]] (*both return {{1, 2}, {3, 4}} *) Flatten[test3] (*returns {1, 2, 3, 4} *)