# Bubble Sort in MATLAB

clc, clear, close all;
tic
nf=.5;
ws=3;

b=imnoise(a,’salt & pepper’,nf);
figure,imshow(b);

[m1 n1]=size(b);
ll=floor(ws/2);
b1=zeros(m1+ws-1); % b1 is zero matrix of 514*514
b1=uint8(b1); % b1 is a unsign 8 bit
[m n]=size(b1);

b1(ll+1:m-ll,ll+1:n-ll)=b;

for i=ll+1:m1-ll
for j=ll+1:n1-ll
f1=b1(i-ll:i+ll,j-ll:j+ll);
f=f1;
n=length(f);
g=size(f);
for k=1:g
for l=g-1:-1:k+1
if(f(l)<f(l+1))
tmp=f(l);
f(l)=f(l+1);
f(l+1)=tmp;
end
end
end
if (0<b1(i,j)&&b1(i,j)<255) %(0<t1(2,2)&&t1(2,2)<255)
else
for i1=9:-1:1 % for i1= (start= 5 : step= -1 : end=1)
if (0<f(i1)&&f(i1)<255) % if
b1(i,j)=f(i1);
break;
end
if (i1==1)
b1(i,j)=f(5);
end
end
end
end
end
[m n]=size(b1);
b2=b1(ll+1:m-ll,ll+1:n-ll); % Size of b2 is 512*512
figure,imshow(b2);
toc

# Asprince Sorting Code in MATLAB

tic
clc
clear all
imshow(a)
nf=.5;
ws=7;
b=imnoise(a,’salt & pepper’,nf);
figure,imshow(b)
[m1 n1]=size(a);
r=floor(ws/2);
b1=zeros(m1+ws-1);
b1=uint8(b1);
[m n]=size(b1);
b1(r+1:m-r,r+1:n-r)=b;
%figure,imshow(b3)
for i=r+1:m-r
for j=r+1:n-r
t1=b1(i-r:i+r,j-r:j+r);
t2=sortrows(t1);
t2=sort(t1(1:end,1:end));
le=length(t2);
len=ceil(le/2);
if (0<t1(r+1,r+1)&&t1(r+1,r+1)<255)
else
if t1(r+1,r+1)==255
for i1=len:-1:1
if (0<t2(i1)&&t2(i1)<255)
b1(i,j)=t2(i1);
break;
end
if (i1==1)
b1(i,j)=t2(len);
end
end
elseif t1(r+1,r+1)==0
for i1=len:le
if (0<t2(i1)&&t2(i1)<255)
b1(i,j)=t2(i1);
break;
end
if (i1==le)
b1(i,j)=t2(len);
end
end
end
end
end
end
b2=b1(r+1:m-r,r+1:n-r);
figure,imshow(b2)
[psnr,mse]=psnr_mse_maxerr(a,b2);
display(psnr);display(mse);
toc

# Ascending Sort Code With Effective Result in MATLAB – M. Ganesh Sai

tic
clc
clear all
imshow(a)
nf=.4;
ws=3;
b=imnoise(a,’salt & pepper’,nf);
figure,imshow(b)

[m1 n1]=size(a);
r=floor(ws/2);
b1=zeros(m1+ws-1);
b1=uint8(b1);
[m n]=size(b1);
b1(r+1:m-r,r+1:n-r)=b;
for i=r+1:m-r
for j=r+1:n-r
t1=b1(i-r:i+r,j-r:j+r);
t2=sort(t1(:));
le=length(t2);
len=ceil(le/2);
if (0<t1(r+1,r+1)&&t1(r+1,r+1)<255)
else
if t1(r+1,r+1)==255
for i1=len:-1:1
if (0<t2(i1)&&t2(i1)<255)
b1(i,j)=t2(i1);
break;
end
if (i1==1)
b1(i,j)=t2(len);
end
end
elseif t1(r+1,r+1)==0
for i1=len:le
if (0<t2(i1)&&t2(i1)<255)
b1(i,j)=t2(i1);
break;
end
if (i1==le)
b1(i,j)=t2(len);
end
end
end
end
end
end
b2=b1(r+1:m-r,r+1:n-r);
figure,imshow(b2)
toc

# Riding In The Dark!

If you wanna refresh your thoughts, go for a walk or journey which will widen your thoughts and that will help to get better results.

# Short Stories to Share-Get Inspired Online Purchase in .PDF

Short Stories to Share-Get Inspired Online Purchase in .PDF

This book is a collection of short stories and articles emphasizing on morals and values. It contains well punched messages at the end of each story leading to lasting impression in the minds of the readers. It focuses on success, attitude, friendship, leadership, motivation and inspiration.

The book deals with honesty and integrity, and backs with short story so that readers can connect quickly with the content and get inspired. It sends a strong message that truth that alone triumphs at the end.

It is an inspirational book. You can easily toss the book into a briefcase or purse and read here and there as time allows.

The book is useful to students from kinder garden (KG) to post graduation (PG) and to all those who have flair for inspirational books.

# Power of Darkness!

When a person is in darkness, they know the value of light. Darkness gives fear; an empty path; and loneliness, but teaches about life.

# Love And Care – M. Ganesh Sai

When a person loves someone and doesn’t gets it back, feels like to do something to themselves or their moral will be down. So love a person who can give their love back to make it warm and comfortable.

# A Story of ‘C’ – M. Ganesh Sai

Once there was a person named Robin. He was an easy going person. He wanted solution for a particular issue, so he called his friend, named-Shiny. She was a nice and naughty girl with excellent maturity levels in her head and heart. He called her and the call was busy. He called again after sometime, still the call was busy. He waited for some time and did his usual works and called back, this time the call rang and she lifted the call.

“Hello Shiny.” Robin greeted.

“Hello Robin. How are you?” Shiny responded.

“I’m fine.” Shiny continued, “It’s so noisy on your side. Are you outside?”

“Yes, I had little work, so I had to come out.” Robin continued, “Are you free for a while?”

“You can talk. I’m a bit free now.” Shiny responded.

“I asked, because, you said there is some exam tomorrow for you.” Robin asked.

“I haven’t received hall ticket for that.” Shiny Continued, “I won’t be attending any exam tomorrow.”

“That’s too bad.” Robin continued, “I wanted to ask you something. Can you suggest me?”

“If it’s possible for me, defiantly I’ll.” Shiny responded.

“What do you mean by that?” Robin asked with a laugh.

“Sometimes, some things can’t be answered.” Shiny continued, “If it’s within my reach, I’ll respond it.”

“That’s okay. I don’t know, in which manner I should ask you.” Robin paused for a moment and said, “I’ll express it like a story and you can respond with conclusion for it. Is it okay for you?”

“Tell me any way you like.” Shiny laughed and continued, “I can understand.”

“Okay! In this, the characters names are A, B, C. A and B are boys and C is a girl.” He said and started the story.

Once there were two friends-A and C. They were friends from childhood and when they were about to join high school they went to different places. After 6 years those two got contact from social networking site. They were chatting and had recollected olden and golden days of their life. C had a crush with B in graduation time and those had break up too. One day, B called A, and said, “Don’t dare to talk with C. If I get any information that you’re talking are chatting with her, she’s going to pay for it, and you too.” A responded, “Sure, Is that it, are you want me to do anything else?” B said, “That’s it.” A responded, “Fine!” and the conversation ended.

“It’s was most stupid story I’ve ever heard.” Shiny continued, “I would like to ask you few things?”

“Okay!” Robin responded.

“Why A and C chatted so much in the first place?” Shiny continued, “Based on the chatting B might’ve got anger.”

“A and C were chatting about their childhood days, jobs and about further studies what and how they are going to pursue.” Robin exclaimed, “What’s the big deal about it to get anger for B?”

“May be B thought that, A can fall in love with C or C can fall in love with A?” Shiny asked.

“A can never be loved by C, and A won’t love C.” Robin responded.

“That’s cool. Have C gave clarity about her love and breakup?” Shiny asked.

“Of course, C is clear about it.” Robin asked her, “A can take it easy and he can move on with his friendship, but he’s worried about C, that’s why he’s thinking what to do?”

“I think C has to be motivated and made her courageous to handle the things.” Shiny continued, “Then B or anyone can never make her moral down again.”

“Your idea is good.” Robin continued, “So shall I bring the C to you, so that you can talk to her.”

“I can’t talk to outsiders the way I talk to you.” Shiny exclaimed, “You know that very well.”

“I think you know C better than me.” Robin responded.

“What? Hey who’s it. Tell me Robin.” Shiny responded with a shock.

“It’s our childhood friend, Div. In the story I mentioned you earlier A was me, B was her boyfriend and C was Div.” Robin continued, “I was puzzled to tell you directly and ask you. Due to that, I expressed everything in detail with Alias, now I’ve revealed their real names to you.”

After Robin expressed that to Shiny, She was busted out with laughter. Robin was on streets and controlled it, but Shiny was laughing for more than 3 minutes. Robin said, “Come on. Stop it, I’m outside. I was controlling my laughter for more than half-an-hour, but you’re making me to laugh.”

“It’s been a long time had such a laugh.” Shiny responded with a laugh.

“I never thought that our childhood friends, especially girls can fall in love.” Robin responded by controlling his laugh.

“Tell Div, to be strong, otherwise I’ll slap her in her face. She’s was one of my best friends from childhood and I hate to see her like this. You better do it Robin.” Shiny expressed her feeling with laughter and anger.

“I’ll. It was nice talking to you.” Robin continued, “Come on, please stop laughing.”

“I can’t. I was recollecting the story you expressed and comparing it now and still it’s too funny.” Shiny responded.

“You keep on laughing. We’ll talk tomorrow then.” Robin continued, “Good night. Take care.”

“Sure! I also have work now. Take care.” Shiny responded and the call ended.

Robin felt better after expressing his views to Shiny. By the time call ended, he reached his home. He got relaxed and approached Div and made here better.

The moral of this story is that, when a person is facing any challenges, it’s better to take suggestion from the people whom you can trust and share it without hesitation. Sometimes self decision may cause harm to others, so do consult with your loved ones.

M. Ganesh Sai

Listed in Marquis Who’s Who in the World in 2014

Email: mgshyd@gmail.com

Speakerpedia: http://speakerpedia.com/speakers/m-ganesh-sai