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

dpb
dpb 2019년 9월 15일
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 2019년 9월 15일
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 2019년 9월 15일
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....

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

 채택된 답변

Walter Roberson
Walter Roberson 2019년 9월 16일

0 개 추천

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

dpb
dpb 2019년 9월 16일
편집: dpb 2019년 9월 16일
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 2019년 9월 17일
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 2019년 9월 17일
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.
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 2019년 9월 18일
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 2019년 9월 18일
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 2019년 9월 18일
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 2019년 9월 18일
thank you very much sir.

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

추가 답변 (2개)

Silpa K
Silpa K 2019년 9월 16일

0 개 추천

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 2021년 2월 21일

0 개 추천

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

Walter Roberson
Walter Roberson 2021년 2월 22일
This does not appear to be an answer to the user's question?

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

태그

질문:

2019년 9월 15일

댓글:

2021년 2월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by