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
Walter Roberson
Walter Roberson 2019 年 9 月 16 日
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
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
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.
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
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 2019 年 9 月 17 日
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)
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
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.
Walter Roberson
Walter Roberson 2019 年 9 月 18 日
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.
Walter Roberson
Walter Roberson 2019 年 9 月 18 日
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);
Walter Roberson
Walter Roberson 2019 年 9 月 18 日
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?

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by