0
votes

I have my graph interval values like this:

-0.068019032
-0.068066120
-0.067618489
-0.067358017
-0.067246556
-0.067266822
-0.066962242
-0.066868663
-0.067033172
.
.

and so on,

for plotting the graph in matlab I did this

    t=0.005:0.005:116;
    subplot(2,2,1)
    plot(t,ALIPUR_EW110907)
    xlabel('t')
    ylabel('X')
    title('Graph 1')

here t is defined on the basis of the data given for intervals as above, I need the interval difference of 0.005, so the overall no.s of intervals will be 116 in this case. So i have hard coded it.((last interval index-0)/0.005).

so it will plot a graph.

Now I need to pic two different random intervals on X-axis and plot the same graph in between those two intervals. Rest of the graph will be discarded.

I am not getting any idea how to do that, please can anyone suggest any help on this. Thanks in advance.

1

1 Answers

0
votes
intr=0.005;
n=<Your file>;
a=length(n)*(0.45);
b=length(n)*(0.75);
arr(b-a)=0;
c=1;
while (c+a)<b
    arr(c)=n(a+c);      
    c=c+1;
end
x=(b-a)/(1/intr);
t=intr:intr:x;

subplot(2,2,2)
plot(t,arr)
xlabel('t')
ylabel('X')
title('Graph 1 Modified')
clear arr a n b t c x intr