Hi, I have a set A that contain 200 points and a subset of the set B.I need to graph the A and I need to mark the points in the set B in A.I can't mark those points correctly.Please help me.

3 Kommentare

dpb
dpb am 15 Sep. 2019
Well, think you'll have to tell us more than that..what did you actually do (show the code) and what isn't what you expected and what would you expect instead?
Attaching sample data and figure showing what it is that isn't what you wanted would always help...
dpb
dpb am 15 Sep. 2019
Answer moved to Comment...dpb
I use a ucr time series data set.I extract some points based on a condition.The extracted points I need to mark in the original set.I use the plot function.
dpb
dpb am 15 Sep. 2019
I don't know what "ucr" means, not do you say a thing useful to help us know what, specifically you have done nor what "a condition" is...POST CODE and DATA, not just words....

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Sep. 2019

0 Stimmen

d = xlsread('FaceFour_TRAIN.xlsx');
plot(d);
hold on
idx = find(d>0.04);
pointsize = 20;
scatter(idx, d(idx), pointsize, 'b', '*')
hold off

15 Kommentare

dpb
dpb am 16 Sep. 2019
Bearbeitet: dpb am 16 Sep. 2019
OP Answer moved to Comment--dpb:
If I use
b=zeros(24,1);
d = xlsread('FaceFour_TRAIN.xlsx')
s=d(1:1,2:end)
plot(s)
hold on
for i=1:24
b(i,:)=i;
c=d(b==i,:)
fa=movstd(c,20,1)
secarray=movstd(fa,20,1)
f=secarray(secarray>.04);
end
disp f
pointsize = 50;
scatter(f, s(f), pointsize, 'r', '.')
hold off
then how can i point f in s .Please help me
b(i,:)=i;
c=d(b==i,:)
fa=movstd(c,20,1)
Why are you doing that? Why are you not just doing
fa = movstd(d(i,:),20,1);
Silpa K
Silpa K am 17 Sep. 2019
I need to find moving standard deviation two times.It is a time series dataset ,then how can I find all the movstd of each row and the max points and I need to mark the max points after the second movstd into the time series.Please help me.Thank you
Do you see some circumstances under which the output of
b(i,:)=i;
c=d(b==i,:)
fa=movstd(c,20,1)
would be different than the output of
fa = movstd(d(i,:),20,1);
?
That is, do you see some circumstances under which
b(i,:)=i;
c=d(b==i,:)
would end up with a c that is differnet than d(i,:) ?
Silpa K
Silpa K am 17 Sep. 2019
But I can't get the result of next steps.If I have
a=[-1,3,4,6,8,-7,-01,-09,-2,5,10]
max=maxk(a,5)
plot(a)
Then how will I get a graph that marked with max.
a = [-1,3,4,6,8,-7,-01,-09,-2,5,10]
[maxvals, maxidx] = maxk(a,5);
x = 1 : length(a);
plot(x, a, 'b-', maxidx, a(maxidx), 'go')
This plots a as a line in blue, and also circles the 5 maxima in green.
Silpa K
Silpa K am 17 Sep. 2019
Thank you very much sir.
I have another doubt if the code is like this
s=d(1:1,2:end)
fa=movstd(s,20,1)
secarray=movstd(fa,20,1)
f=secarray(secarray>.04);
max=maxk(f,10)
then how mark the max in s.(d is dataset)
s = d(1:1,2:end);
fa = movstd(s,20,1);
secarray = movstd(fa,20,1) ;
secidx = find(secarray>.04);
f = secarray(secidx);
[maxvals, maxidx] = maxk(f,10);
sidx = secidx(maxidx);
x = 1:length(s);
plot(x, s, 'b-', sidx, s(idx), 'go', sidx, maxvals, 'k*')
This plots a line for the original s. On that line, it will circle the points that turned out to have the maximum f value in green. This code also will plot the location and values of those maximum f as black asterisks.
Silpa K
Silpa K am 18 Sep. 2019
If it possible to mark only the max in s(using only the plot of s),without other things.
s = d(1:1,2:end);
fa = movstd(s,20,1);
secarray = movstd(fa,20,1) ;
secidx = find(secarray>.04);
f = secarray(secidx);
[maxvals, maxidx] = maxk(f,10);
sidx = secidx(maxidx);
then
plot(sidx, s(idx), 'go')
Though possibly you would instead prefer
hold on
for idx = 1 : length(maxidx)
xline(maxidx(idx),'g');
end
hold off
Silpa K
Silpa K am 18 Sep. 2019
sir,using this getting errors.I need to mark the max points only in s.The max points are from secarray that contain 14 points.
plot(sidx, s(sidx), 'go')
Silpa K
Silpa K am 18 Sep. 2019
I need to plot the s.In the graph of s the max need to mark.The max is from the secidx
s = d(1:1,2:end);
fa = movstd(s,20,1);
secarray = movstd(fa,20,1) ;
secidx = find(secarray>.04);
s = d(1:1,2:end);
fa = movstd(s,20,1);
secarray = movstd(fa,20,1) ;
secidx = find(secarray>.04);
f = secarray(secidx);
[maxvals, maxidx] = maxk(f,10);
sidx = secidx(maxidx);
x = 1:length(s);
plot(x, s, 'b-', sidx, s(sidx), 'go')
Silpa K
Silpa K am 18 Sep. 2019
thank you very much sir.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Silpa K
Silpa K am 16 Sep. 2019

0 Stimmen

d = xlsread('FaceFour_TRAIN.xlsx')
f=d(d>.04);
plot(d)
I need to mark the f in d and the d I need to represent like a single plot.How it possible please help me.
inusah alhassan
inusah alhassan am 21 Feb. 2021

0 Stimmen

s = d(1:1,2:end);
fa = movstd(s,20,1);
secarray = movstd(fa,20,1) ;
secidx = find(secarray>.04);
f = secarray(secidx);
[maxvals, maxidx] = maxk(f,10);
sidx = secidx(maxidx);
x = 1:length(s);
plot(x, s, 'b-', sidx, s(sidx), 'go')

1 Kommentar

Walter Roberson
Walter Roberson am 22 Feb. 2021
This does not appear to be an answer to the user's question?

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by