# Removing Points Along a Diagonal Line

2 views (last 30 days)
racqs on 30 Jul 2019
Commented: darova on 31 Jul 2019
I have a slope that i have discretized into points. However along the diagonal line I would like to remove all the points to the right of this line. Is this possible? All I have been able to do is remove the points as shown in the second figure but my slope actually looks like the first figure. The points to be reomved are all those lying within the shaded region. Is this possible? infinity on 30 Jul 2019
Hello,
I would suggest you a solution,
Since you have known two points of slope, which are (40,35) and (74.4, 15), you can easily get a segment passing to these points. Let say, y = ax + b.
Then, you can define a function, for example phi(x,y) = ax + b - y. As it can seen that phi(x,y) > 0 if (x,y) is in the left of the slope and phi(x,y) < 0 if (x,y) is in the right of the slope and phi(x,y) = 0 if (x,y) is in the slope. This technique is called "levelset method".
Now, what you can do is to use the phi funtion to check a point is in the left or the right of the slope. If it is in the right, you just eleminate it.

racqs on 31 Jul 2019
B contains the nodes I would like to remove from the full matrix A. I would like to get the remaining nodes. ie A without the nodes B
infinity on 31 Jul 2019
Hello,
So, you could use for loop (or even don't need for loop) to check wheather a nodes in A is in B or not. If it is not, you store it into a new variable. For example,
clear
A = [1 2; 3 4; 5 6];
B = [3 4; 5 6];
C = [];
for i = 1:size(A,1)
if ~ismember(A(i,1),B(:,1)) || ~ismember(A(i,2),B(:,2))
C = [C; A(i,:)];
end
end
darova on 31 Jul 2019
{"ft_lang_label":"__label__en","ft_lang_prob":0.95506066,"math_prob":0.96172553,"size":652,"snap":"2020-24-2020-29","text_gpt3_token_len":195,"char_repetition_ratio":0.16358025,"word_repetition_ratio":0.05882353,"special_character_ratio":0.31748468,"punctuation_ratio":0.15697674,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99165034,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,9,null,9,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-10T07:29:55Z\",\"WARC-Record-ID\":\"<urn:uuid:e3ed6bd5-50c6-475d-97b1-1958e00327c3>\",\"Content-Length\":\"128236\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:46840faf-390f-4f56-86e1-83d94c69ed9c>\",\"WARC-Concurrent-To\":\"<urn:uuid:5476d760-8183-4406-8c8b-9e70eed5d9d0>\",\"WARC-IP-Address\":\"23.66.56.59\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/answers/474119-removing-points-along-a-diagonal-line\",\"WARC-Payload-Digest\":\"sha1:RPSIWXHXZZ2M6AKIDOLDAKYCSUJ6LN2G\",\"WARC-Block-Digest\":\"sha1:WIFJ3GAMGEEZW2YGASTHQCAEI2SSWHXZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593655906214.53_warc_CC-MAIN-20200710050953-20200710080953-00007.warc.gz\"}"}