필터 지우기
필터 지우기

Combining a structures sub catagories

조회 수: 2 (최근 30일)
Ryan
Ryan 2012년 1월 13일
I have a structure, 'Lines', that is made of 3 parts; 'Start', 'End', and 'Points'. 'Start' and 'End' are 2D coordinates for a series of lines. I want to quickly find the closest start or end point to a given 2D coordinate. To do this is I intend to create an Xx2 array of the start points (where X is the number of lines in the structure), subtract test_point(ones(X,1),:) and do sqrt(sum(result)). The problem that I have is combining the 'Start' into a Xx2 array. I can use [lines.start] to create a 1xX array but I need it in an Xx2 for this method.
Thanks in advance, Ryan Giles.

답변 (1개)

Ryan
Ryan 2012년 1월 13일
I found the solution; vertcat(lines.start)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by