how to find the length between two ticks ?

1 回表示 (過去 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 Center および File ExchangeVisual Exploration についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by