How to calculate mean or variance in a string ?
6 次查看(过去 30 天)
显示 更早的评论
Hi, I have a jumbled text and i wish to straighten it out using machine learning . I wanted to calculate the variance of the jumbled text . Can anyone suggest me a method on how to do it ?
2 个评论
Salaheddin Hosseinzadeh
2014-8-26
Hi Mani,
I've no idea how to do that.
Do yourself a favor, add this details to your question, because I'm going to remove my answer so other ppl notice your question is left unanswered.
Thanks.
Star Strider
2014-8-26
What do you mean by ‘jumbled text’? Is it a replacement cipher, with one letter replacing another repeatedly ( i.e. a=m, g=b, q=e ) or some such?
采纳的回答
Andrew Reibold
2014-8-26
编辑:Andrew Reibold
2014-8-28
You can convert to ascii equivalent, then find variance.
jumble_text = 'alskdjbfalksjbdf'
ascii_text = double(jumble_text)
mean_text = mean(ascii_text)
squared_dif = (ascii_text - mean_text).^2
variance = mean(squared_dif)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!