how to find the length between two ticks ?

조회 수: 2 (최근 30일)
Samaneh Arzpeima
Samaneh Arzpeima 2019년 1월 23일
편집: Samaneh Arzpeima 2019년 1월 24일
Hello Everybody
I need your help.
I am trying to plot a scale on my graph,I did it with the help of my last question
now to plot the value on my horizontal line on the sclae(left top , ? cm/s) I need to have the length between each plot(interval). how many mm or cm is between data on point 0km and point 5km(interval between ticks).I don't know how to find this length!
Then I probably need to find the max of each data and divide it to this lenght. I suppose this will give me the answer for ?m/s
Thank you

답변 (2개)

KSSV
KSSV 2019년 1월 23일
Read about imdistline. With this you can get the distance interactivley....If you want by code..you need to pick the points and use distance formula.
  댓글 수: 4
Samaneh Arzpeima
Samaneh Arzpeima 2019년 1월 23일
"getpts" also is an "image processing toolbox " option.
KSSV
KSSV 2019년 1월 23일
huumh...then ginput ..what daata you have in hand by the way?

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


Samaneh Arzpeima
Samaneh Arzpeima 2019년 1월 23일
편집: Samaneh Arzpeima 2019년 1월 23일
this is a 2d figure but it actually has 3 parametrs. I am trying to plot time history of velocity on specific point of space. 
t=time(:,1); %10000*1
y=alongstrike(1,:); %1*41 (-100:5:100)
hold all
figure()
for i=1:41
plot((sliprate(:,i).*20+alongstrike(1,i)),time(:,i)) %sliprate is 10000*41
end
ylim([0 100])
set(gca,'Xdir','reverse')
xlabel('Strike direction (km)','FontSize',12)
ylabel('Time (s)','FontSize',12)
hold on
plot([80; 85], [110; 110], '-k', [80; 80], [110; 120], '-k', 'LineWidth', 2)
hold off
axis([[-110 110] 0 120])
text(82,115, '10 s', 'HorizontalAlignment','right')
text(88,107, '? cm/s', 'HorizontalAlignment','center')
set(gca, 'YTick', [0:20:100])
hold on
plot([60; 80], [10; 15], '-k', [60; 80], [10; 25], '-k','LineWidth', 2)
hold off
text(85,28, '2 km/s', 'HorizontalAlignment','center')
text(85,18, '4 km/s', 'HorizontalAlignment','center')
now need to plot the scale on figure.

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by