repflag=true;
古いコメントを表示
hi there.. i am converting matlab codes which have "repflag=true" i don't understand this kindly someone guide me...
thanks in advance.
10 件のコメント
David Goodmanson
2019 年 12 月 28 日
Hi Sher,
impossible to say since you have not provided any context. Regardless, what you could do at least as well as anyone on this site is scan down through the rest of the code until you find
if repflag % or possibly if repflag==true
blah
blah
blah
end
and try to scope out what it does.
Sher Akbar
2019 年 12 月 28 日
David Goodmanson
2019 年 12 月 29 日
is 'data' a vector, or is it a matrix?
Walter Roberson
2019 年 12 月 29 日
The code appears to be looping replacing outiers with the mean of the data, until finally there are no more outliers.
Sher Akbar
2019 年 12 月 29 日
David Goodmanson
2019 年 12 月 29 日
HI Sher,
best to figure out what it's doing, then write a new version in R. The comment says it's recursion, but it's really iteration.
Using ns = 3 as an example, then as Walter mentioned, take the outlier measurements that lie more than 3 standard deviations away from the mean, and replace them by the mean. That makes a new data set. Then find a new mean and standard deviation and repeat the process until there are no more outliers. Why someone would use that process is a question worth asking, if you don't know already.
During the process, count up the outliers on each side of the mean. The spikes = (spikes ==1) statement seems to be in order to avoid double counting any outliers, same for drops.
Sher Akbar
2019 年 12 月 29 日
Sher Akbar
2019 年 12 月 29 日
David Goodmanson
2019 年 12 月 29 日
Hi Sher, I don't know R and redoing this in R is not really within the scope of this website.
Sher Akbar
2019 年 12 月 29 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!