Correctly plot the quiver on a figure

조회 수: 2 (최근 30일)
sparsh garg
sparsh garg 2021년 9월 15일
댓글: sparsh garg 2021년 9월 15일
I am currently trying to project the point along the direction of the normals.However my current method tends to project them in a diagonal manner.
The original img
Now i use this code to ensure that my points are displayed in correct order(Note I can always do set(gca'YDir','reverse') )
plot(Fp(1,:),max(Fp(2,:))+1-Fp(2,:));
%plot(E_stroke(1,:),max(E_stroke(2,:))+1-E_stroke(2,:));
%plot(FP1(1,:),max(FP1(2,:))+1-FP1(2,:));
axis equal;
ax=gca;
h = findobj(gca,'Type','line');
x = h.XData;
y = h.YData;
Final_set_pts=[x;y];
After this when I plot the normals I get this figure,any idea what is happening here
  댓글 수: 4
KSSV
KSSV 2021년 9월 15일
Dot indexing is not supported for variables of this type.
Error in file (line 3)
quiver(edges2.x+edges2.nx,edges2.y+edges2.ny,-edges2.nx,-edges2.ny);
sparsh garg
sparsh garg 2021년 9월 15일
oh okay that is b'cause the edgepixel is a structure but when I upload it and send it to someone else,it comes out as a a simple matrix.
edge_norm is nothing but [edgees2.nx,edges2.ny] and edge_pos is [edges2.x,edges2.y];
Also how do we go about saving classdef objects in matlab so that when you send them as attachments,the end person recieves that object in the right format.
For example edges2.mat is a object which somehow got converted into a matrix.

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

답변 (1개)

KSSV
KSSV 2021년 9월 15일
Try changing (x,y) i.e. use (y,x) instead.
  댓글 수: 1
sparsh garg
sparsh garg 2021년 9월 15일
hmmm i changed that but still no changes the plot tends to be the same as before.

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by