How to plot a graph based on user input???

7 次查看(过去 30 天)
Hello, kindly help me to solve this issue..I want to plot a graph based on interval which is given by
user
%%%%my code %%%
AA = input('enter the value of speed'); %%as of meter/second
speed = AA*3.6 %%convert into km/hr
speed_0 = speed/60; %%calc for minute
speed_1 = speed/3600; %%calc for second
speed_2 = speed_1/1000; %%calc for Millisecond
sortiedate = [2018,03,23]
b = input('enter the range');
num = input('enter the interval to plot');
pp =round(log10(num));
if pp == -1
ms =1/(24*60)
end
if pp == -1
for bb =1:5
t(bb) = sqrt((speed_0*bb).^2 +(b.^2));
end
dd = fliplr(t);
dd_1 = b;
dd_2 = t;
ee = [dd,dd_1,dd_2];
time_1 = (0:1:10)
abc = length(ee)
stime = datenum(2018,03,23,10,00,00)
endtime = datenum(2018,03,23,10,10,00)
ms = 1/(24*60)
tme = stime:ms:etime
tme_1 = datevec(tme)
datetime = [(tme_1)]
time_s = datenum (double(datetime));
figure
title ('range vs time')
xlabel('time_s (minutes)')
ylabel('range (km)')
hold on;
grid minor
plot(time_s,ee,'r.-')
legend('range vs time')
DynamicDateTicks();
end
I know I have to pass the variable 'num' in plot function,but I am not getting a correct answer.
Instead of changing in interval,range (yaxis) values are getting changed.
  4 个评论
Walter Roberson
Walter Roberson 2018-4-2
0.10 is the same number as 0.1. Ten of 0.1 is 1.0
Kingsley Bowoto
Kingsley Bowoto 2020-11-6
Its not working for me. Please can you give us what the inputs should look like.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by