how to combine the coordinates of points of 2 column vectors for specific width

Thanks for community support. let me phrase my questions with more detail lets suppose i have vertices of a tea cup.
Vx =[ 0;1;2;0;9]
Vy = [1;1;,2;;3]
Vz= = [38,32,-1]
They are cancatenated in a larger matrix = [Vx Vy Vz].
After sorting, i want to find first elements or coordinates like (0,1,38) here in Vx,Vy,Vz wherever they meet or match, it should be labelled as 5 in that particular grid.
Your guidance will be highly appreciated.
regards

댓글 수: 2

"They are cancatenated in a larger matrix = [Vx Vy Vz]."
No they aren't -- can't be because
size(Vx) --> 5,1
size(Vy) --> 4,1
size(Vz) --> 1,3
so never shall they match w/o help...
okay. lets Vx, Vy and Vz are same size. then how can we extract the first coordinates of all three vectors to make a point and label it as 5

댓글을 달려면 로그인하십시오.

답변 (1개)

matrix(1,:) % extracted the first coordinate , however I don’t know what you mean by label them as five perhaps text() is what you’re looking for??

댓글 수: 12

Mr. Ravi, thanks for the reply but i want to find, wherever they meet, i want to label with 5.
i mean, the first coordinates of Vy and Vz are matching, so replace that grid by 5
I still don’t understand, sorry. Could you illustrate your desired output with a relative example?
Mr. Rave, thanks for reply. let me explain in detail.
Vx and Vy are big vectors but let me summarize it with short example.
Vx = [ 1 -112 103 114 ]
Vy = [ -114 225 237, 208 ]
Max Vx = 114, min Vx = -114
Max Vy = 280, min Vy = -20
width or range of Vx = 10
width or range of Vy= 10
i want to fix the elements of the above matrix as per the width 10. if any where, they are coming in the same width or range, replace that place of matrix by 5.
i hope, now you may get my question.
thanks for all cooperation and anticipation.
At least take the level of care to make your examples numerically correct and show the end result desired and how you deduced that...
Above
Min/Max Vx --> -112, 114 not -114,114
Min/Max Vy --> -114, 208 not -20,280
You don't show how the width or range parameter enters into the question at all nor what you think the result should be.
We can't read your mind, sorry...we only know what you tell us, specifically.
i want to fix the elements of the above matrix as per the width 10. if any where, they are coming in the same width or range, replace that place of matrix by 5.
What does a number coming in a width mean? Mathematics is a very precise language, please use the correct terms.
Why 5 and not 1, sqrt(2), pi or any other number?
Maybe you're wanting to bin your data. I.e. any Vx(i) that satisfies is mapped to 1, any Vx(i) that satisfies is mapped to 2, etc.
If so, how does this work with 3D coordinates?
thanks for reply MR. DPB ,you are extracting min and max from given elements of Vx and Vy while its only example otherwise Vx and Vy are big vectors. i am thinking, how the elements can be separated using width of 10 or 5 or 3 ( e.g. width 5, the elements can be -1, -2,1,2,3,4).
i want to combine elements under specific widths and then want to label or fill that grid by any specific number like 4 or 3 (any number ).
Mr. Guillaume. thanks for reply.
i am thinking, how the elements can be separated using width of 10 or 5 or 3 ( e.g. width 5, the elements can be -1, -2,1,2,3,4).
i want to combine elements under specific widths and then want to label or fill that grid by any specific number like 4 or 3 (any number ). i am not interested to bin it. i want to use for 2 diemension coordinates. latter we can apply for 3 dimensional coordiantes.
regards
It's still not any clearer and it really does sound like what you want is some sort of binning.
Can you give a concrete example, given the inputs:
Vx = [0 0 0 0 0 3 3 3 3 3 6 6 6 6 6 9 9 9 9 9 11 11 11 11 11]
Vy = [0 3 6 9 11 0 3 6 9 11 0 3 6 9 11 0 3 6 9 11 0 3 6 9 11]
width = 5
What exact output do you want?
result = ???
Thanks Mr. Gulliaume for your guidance.
how to use matlab coding to group vx and vy elements with respect to width=5
xy =[Vx;Vy]; % you haven’t responded to Guillaume’s question still!
width=5;
reshape(xy,size(xy,2),[],width)
Mr. Ravi, i am still struggling with it but trying to utilize reshape function on my problem. lets me figure out but still very confusiong problem to handle it.
i am still struggling with it
If, instead of answering my question by another question, you'd actually answered it, we probably could have figured what it is you want. So once again, given the inputs:
Vx = [0 0 0 0 0 3 3 3 3 3 6 6 6 6 6 9 9 9 9 9 11 11 11 11 11]
Vy = [0 3 6 9 11 0 3 6 9 11 0 3 6 9 11 0 3 6 9 11 0 3 6 9 11]
width = 5
What do you want as output. Use valid matlab syntax to fill the following:
result = ????

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2019년 6월 13일

댓글:

2019년 6월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by