Monday, December 21, 2009

crocodile is floating ေရအိုးထဲမိေက်ာင္းေပၚေနျပီ။

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
words study (Burmese)

crocodile is floating ေရအိုးထဲမိေက်ာင္းေပၚေနျပီ။

crocodile s floating in the drinking water pot;this expression is used to mock shallowness of drinking water pot at home;
it is also used to mention the shallow water level in the river
in summer.
Example To tease his wife's late filling of water ,U Hla shouts " crocodile is floating in the drinking water pot".
tease(verb) to make fun of somebody, either playfully or maliciously.
တေယာက္ေယာက္ ကို "ေနာက္ေျပာင္"သည္။ဦးလွသည္ သူ.ဇနီးကို ေနာက္ေျပာင္လိုသျဖင္. ေသာက္ ေရအိုးထဲမိေက်ာင္းေပၚေနျပီ ဟုုဟစ္ေအာ္ေျပာဆိုလိုက္ပါတယ္။

su nyein nyein chan ,computer Fresher,
Kyauk se Computer University.
Monday, December 21, 2009

Sunday, December 20, 2009

Blasphemy[n] ဘုရားအၾကည္ညိ ုပ်က္ေစမွ ု

%%%%%%%%%%%%%%%%%%%%%%%%%
words study (English)
Blasphemy[n]/ piety ဘုရားအၾကည္ညိ ုပ်က္ေစမွ ု
profanity, wickedness, mockery,
disrespect ,mockery, derision.

An eminent Iran poet is sentenced to (5) years for blasphemy.
အီရန္ကဗ်ာဆရာတဦးကို
ဘုရားအၾကည္ညိ ုပ်က္ေစမွ ုျဖင္.ေထာင္ဒါဏ္(၅)ႏွစ္ခ်လိုက္သည္။
ကိုရန္က်မ္းစာမွစာပိုဒ္အခ်ို ု.ကို ကိုသူ၏ကဗ်ာတြင္ထည္.သြင္းေဖၚျပခဲ.ျခင္းေၾကာင္.ျဖစ္ပါသည္။

su nyein nyein chan ,computer Fresher,
Kyauk se Computer University.
Monday, December 21, 2009
Monday, December 21, 2009

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Word study (English)dire consequencesေႀကာက္မက္ဖြယ္အက်ိ ုးဆက္

Sunday, December 20, 2009
Word study (English)
ျမန္မာမွ ု

စုျငိမ္းျငိမ္းခ်မ္း၊ကြန္ျပ ူတာဖရက္ရွာ၊
ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ။
su nyein nyein chan ,computer Fresher,
Kyauk se Computer University.
Saturday, December 19, 2009

At the Copenhagen conference on climatic change,scientists
predict that if we can not limit temperature rise to 1.5 degree Celsius, we will face dire consequences.

ကုိပင္ေဟဂင္တြင္က်င္းပေသာရာသီဥတုဆိုင္ရာညီလာခံတြင္
အပူခ်ိန္တိုးႏွ ုန္းအား ၁.၅ ဒီဂရီကိုမကန္.သတ္နိ ုင္လွ်င္ ၾကီးမားေသာေၾကာက္မက္ဖြယ္အက်ိ္ ုးဆက္မ်ားကိုရင္ဆိုင္ရ
လိမ္.မည္ဟုပညာရွင္မ်ားကေဟာကိန္းထုတ္လိုက္ပါသည္။

Dire(adj.)/ wonderful (ေႀကာက္မက္ဖြယ္)terrible, awful, calamitous, ominous, dreadful ,horrible, grim, disastrous, frightful, appalling.

Consequence(n) (အက်ိ ုးဆက္) result ,effect, outcome .
စုျငိမ္းျငိမ္းခ်မ္း၊ကြန္ျပ ူတာဖရက္ရွာ၊
ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ။
su nyein nyein chan ,computer Fresher,
Kyauk se Computer University.
Sunday, December 20, 2009

%%%%%%%%%%%%%%%%%%%%%%%%%%%

making Buddha statue to nod/ဆင္းတုေတာ္ကိုေခါင္းညိတ္ေအာင္ ေျပာ ဆိုနိ ုင္သည္။

Word study (Burmese)

Friday, December 18, 2009

စုျငိမ္းျငိမ္းခ်မ္း၊ကြန္ျပ ူတာဖရက္ရွာ၊

ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ။

su nyein nyein chan ,computer Fresher,

Kyauk se Computer University.

Saturday, December 19, 2009

ျမန္မာမွ ု

ရဲေဘာ္ဖိုးသန္ေခ်ာင္းသည္ဗမာျပ ည္ကြန္နစ္ပါတီ၀င္တဦးျဖစ္သည္။

ဗမာျပ ည္ကြန္နစ္ပါတီ၀င္မ်ားသည္ စကားေျပာေကာင္းၾကသည္ ။

ရဲေဘာ္ဖိုးသန္ေခ်ာင္းသည္ ဆင္းတုေတာ္ကိုေခါင္းညိတ္ေအာင္ ေျပာ

ဆိုနိ ုင္သည္။

Comrade than gyaung is a member of "Burmese Communist Party".Burmese communists are normally eloquent.

He is so eloquent that he can make Buddha statue to nod.

အခ်ိန္ ဆြဲ တာ ကို မေဗဒါေရ ဘူး ခတ္ ခိုင္းသလုိ ဟု တင္စား

ေျပာ ဆိုသြားပါ သည္။

To emphasise time delaying ,comrade than gyaung

uses the phrase "Ma bay dar filling a big pot with a

small hole".

Glossary

eloquent (adj.) fluent, persuasive, powerful စကားေျပာေကာင္းသည္၊ဆြဲေဆာင္မွ ုရွိိ သည္၊အင္အားရိွ သည္။

nod(v) indicate agreement ,concur

သေဘာတူညီမွ ုညႊန္ျပသည္၊ထပ္တူသည္။



concur(v) agree, be of the same mind, be together.

သေဘာတူညီသည္၊စိတ္တူညီသည္၊အတူတကြျဖစ္

သည္။

Statue(n)ဘုရားရုပ္တုေတာ္

စုျငိမ္းျငိမ္းခ်မ္း၊ကြန္ျပ ူတာဖရက္ရွာ၊

ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ။

su nyein nyein chan ,computer Fresher,

Kyauk se Computer University.

Saturday, December 19, 2009

%%%%%%%%%%%%%%%%%%%%%%

Tuesday, December 15, 2009

sun is shining on the buttock / ေနဖင္ထိုးေနျပီ ေနျမင္.ေနျပီ

16 december 2009

Burmese words study


ေနဖင္ထိုးေနျပီ ေနျမင္.ေနျပီ

sun is shining on the buttock,time is too late ,time to get up



ဥပမာ -- ေမာင္ ေအးခ်မ္း အိပ္ရာထေတာ. ေနဖင္ထိုးေနျပီ ေနျမင္.ေနျပီ ဟု သူအဖိုးကေျပာဆိုျပီးသူေျမး
ကိုအိပ္ရာ မွႏိွ ုးပါသည္။



The grand father shouts "Mg Aye Chan ,get up; sun is shining on the buttock;time is too late;time to get

up ,you will be late for school".


sunyeinnyeinchan စုျငိမ္းျငိမ္းခ်မ္း ဖရက္ရွာ,

hairy in the wrong place/ တလြဲဆံပင္ေကာင္း

16 dec. 2009
ျပံ ုးယံုသာ
hairy in the wrong place/ တလြဲဆံပင္ေကာင္း
ဦး၀င္းႏိုင္သည္ နဖူးက်ယ္သူတဦးျဖစ္ပါသည္
ေနာက္ေျပာင္လိုေသာအဖိုးအိုတဦးမွေအာက္ပါအတိုင္းမွတ္ခ်က္ခ်လိုက္ပါသည္။
(ဦး၀င္းႏိုင္ ခင္ဗ်ားက တလြဲဆံပင္ေကာင္း ေနတာဘဲ)
ဆရာျငိမ္း

TRANSLATION IN ENGLISH
JUST TO SMILE
u win naing is a bald-headed veteran;
remarks by a joke-loving old man,
ko win naing, you are more hairy in the wrong place!
(hairy/bald covered with hair, long-haired)

ေမွာ္ပညာ? black magic 16 december 2009

black magic/30 october 2009


ထမိန္ျခံ ုလွ်င္ လဒ ျဖစ္တယ္ လို. ေအာက္လမ္းဆရာတို.ကဆိုၾကတယ္။

ထမိန္ျခံ ုလွ်င္ လဒ ျဖစ္တယ္ လို. ေအာက္လမ္းဆရာတို.ကဆိုၾကတယ္။

ထမိန္ျခံ ုလွ်င္ လဒ ျဖစ္တယ္ လို. ေအာက္လမ္းဆရာတို.ကဆိုၾကတယ္။


Friday, July 04, 2008

16 AUGUST 2009


Warning to "panty for peace" campaigner.


Most people think , it is a bad omen for receiving as present or wearing woman's underwear on top of head.

But for some, especially those who practise black magic, it is an auspicious sign.

Black magicians say "If you worship and put a woman's underwear on top of your head you will become a vulture and get power to perform miracles".

If you send women's underwears to such people, they may appreciate your actions.

ထမိန္ျခံ ုလွ်င္ လဒ ျဖစ္တယ္ လို. ေအာက္လမ္းဆရာတို.ကဆိုၾကတယ္။



aung myat thu

A magic wand ?Aladin’s wonderful magic lamp ? အာလာဒင္ ေမွာ္မီးအိမ္၊

INTERNE(1)(www dot com)
A wizard’s magic wand ?
Aladin’s wonderful magic lamp ?
Cindrella ‘s magic shoe ?
Saya Nyein
Prof. U Hla Myint,
(AE-119686)
Department of Electronic Engineering,
Defense Services Technological Academy,
Pyin Oo Lwin.
A wizard with a “magic wand” can fulfill his wishes.
Aladdin with his wonderful magic lamp looked for a beautiful princess and his wish was
fulfilled by rubbing his Magic lamp.
Cindrella found her wonderful prince by means of her golden shoe.
Internet is more or less modern equivalent of magic lamp.
The difference is “you have to rub the lamp” and “you have to click the mouse” for the
miracle to happen.
*You can get your “beautiful princess” not by rubbing but by clicking your magic
mouse.
There are many agents who make matches with your specifications for a very reasonable
fee.Two popular love-agents at present are www.loveHappens.com and
www.eHarmony.com.
Last Saturday, my eldest daughter and her husband attended a wedding reception.
The bride ( Cindrella) is a lovely and wealthy lady from Mandalay and the groom
(Golden prince) is a young handsome military officer from Pyin Oo Lwin.
They were matched by love-agent website www.loveHappens.com.
If you forget to specify age range, the agent may match you with 80 year-old lady or
gent! Your princess’s age may lie between 15-80 years !.
*With a click of a mouse , you can mail instantly hundreds of friends , relatives and even
strangers living thousands miles away at the speed of 186,000 miles per second and you
don’t have to worry whether your mail reach the receipients.Because you will be
informed instantly that your mail is sent successfully or delayed or your mail address is
wrong.If it is delayed because of information traffic jam, it will be delivered as soon as
traffic is light.
* If you are a businessperson ,you can do business with thousands of corporations at the
speed of light.
*You can purchase any commodity on line.
*You can talk light or serious at a reasonable cost ( about 500 kyats per hour)with a
friend who live housands of miles away( a former Electronic Engineering graduate of
DSTA studying in USSR).
*If you are an Electronic engineer or a physicist , you can get relevant information about
chips or diodes , transistors, integrated circuits, or whatever hardwares(2) or softwares(3)
or firmwares(4) of your interest from hundreds of sites with a few clicks of mouse on
relevant links.How many clicks you will have to make depend on your experience on
” surfing.5” the Web.
*If you’re a student intending to study abroad, you can contact thousands of Universities
all over the world with a few clicks of mouse.
In my opinion, Internet is more or less modern equivalent of magic lamp.
Glossary
1.Internet
n. The worldwide collection of networks and gateways that use the TCP/IP suite of
protocols to communicate with one another. At the heart of the Internet is a backbone of
high-speed data communication lines between major nodes or host computers, consisting
of thousands of commercial, government, educational, and other computer systems, that
route data and messages. One or more Internet nodes can go off line without endangering
the Internet as a whole or causing communications on the Internet to stop, because no
single computer or network controls it. The genesis of the Internet was a decentralized
network called ARPANET created by the Department of Defense in 1969 to facilitate
communications in the event of a nuclear attack. Eventually other networks, including
BITNET, Usenet, UUCP, and NSFnet, were connected to ARPANET. Currently, the
Internet offers a range of services to users, such as FTP, e-mail, the World Wide Web,
Usenet news, Gopher, IRC, telnet, and others.
2.hardware
n. The physical components of a computer system, including any peripheral equipment
such as printers, modems, and mouse devices.
3.software
n. Computer programs; instructions that make hardware work. Two main types of
software are system software (operating systems), which controls the workings of the
computer, and applications, such as word processing programs, spreadsheets, and
databases, which perform the tasks for which people use computers. Two additional
categories, which are neither system nor application software but contain elements of
both, are network software, which enables groups of computers to communicate, and
language software, which provides programmers with the tools they need to write
programs. In addition to these task-based categories, several types of software are
described based on their method of distribution. These include packaged software
(canned programs), sold primarily through retail outlets; freeware and public domain
software, which are distributed free of charge; shareware, which is also distributed free of
charge, although users are requested to pay a small registration fee for continued use of
the program; and vaporware, software that is announced by a company or individuals but
either never makes it to market or is very late. Your spouse age may lie between 15-80
years !
4.firmware. Software routines stored in read-only memory (ROM). Unlike random access
memory (RAM), read-only memory stays intact even in the absence of electrical power.
Startup routines and low-level input/output instructions are stored in firmware. It falls
between software and hardware in terms of ease of modification.
5.surf
vb. To browse among collections of information on the Internet, in newsgroups, in
Gopherspace, and especially on the World Wide Web. As in channel surfing while
watching television, users ride the wave of what interests them, jumping from topic to
topic or from one Internet site to another. Also called cruise
Saya Nyein
Prof. U Hla Myint,
(AE-119686)
Department of Electronic Engineering,
Defense Services Technological Academy,
Pyin Oo Lwin.
17 july 2006

how to handle a nagging wife! / ဂ်ီက်ေနေသာဇနီး ကိုဘယ္လိုလုပ္ရပ?

how to handle a nagging wife!
ဂ်ီက်ေနေသာဇနီး ကိုဘယ္လိုလုပ္ရပ?



25 august 2009 tuesday


nagging(v) to be a persistent cause of discomfort, anxiety, or unease.

tjrJ*sD usaeaom

Mandalay.

Breakingnews » Breakingnews puf&yfowif;

vef'ef-

ZeD;o,fudkpdwfukefaeaomjAdwd&ScifyGef;o,fwOD;uola&mif;rnf.ukefpm&

if;wGifol.ZeD;udkxnf.oGif;aMumfNimvdkuf&m

0,f,lvdkolawmfawmfrsm;rsm;ay:aygufvmaMumif;Bum;od&onf/

*,f&Dbdwf(3*)onfarmfawmfum;ESif.tdrfoHk;ypfpnf;a&mif;0,folwOD;jzpf

ygonf/ aMumfNimwGif oHacs;eJeJwufae onf rSty

tcGefvGwfonf (No Tax)

rdefwdef;eif.tvGefaumif;aumif;vkyfxm;onf(Very high

maintenance) ponfjzif.az:jyxm;onf/

t*Fveftaemufawmif ydkif;

*vlpwm;&dSif;&m;(Nynfe,f)om;udk,fydkifaqmufvkyfa&;vkyfief;&Sif

rpfpwm bdwfonf wDAGD

Munf.ae&m rS ol.udk *sDus em;yl em;qmvkyf aeonf.cspfZeD; a':em

udkajymifavSmifvdkojzif.,ckaMumfjimudkxnf.vdkufjcif;jzpfygonf/

uRefawmfeJeJrSm;oGm;wmav;udktrdS kufo&dkufwDAGD y&dk*&rfMunf.ae&mrS *sD

us aeoNzif.olrudkz,f&Sm;&ef,ckaMumfjimudkxnf.vdkufjcif;jzpfygonf/

b,folwOD;wa,mufrSqufoG,far;jref;r,frxifaomfvJteJqHk;(10)a

umvfavmufvufcH&&dSygonf/todxJrSwa,mufrSrygaomfvJ(a':emudk

&ed kifao;ovm;?)ar;oHxyfcgwvJvJMum;ae&ygonf/

rpfpwmbdwfwdk.,refESpfrSvufxyfcJ.jcif;jzpfygonf/

,ckaMumfjimudkr*f*Zif;\(tcrJ.vufaqmiftcef;) (Free to Collect

section)wGifaMumfjimcJ.jcif;jzpfygonf/

Monday, April 13, 2009, mandalay

owif;ydk.ol----—uavmiftrnf-pkjidrf;jidrf;csrf;

trnf&if; -OD;vSjrif.

rSwfyHkwiftrSwf-9-r&r(ed kif )050285

vdyfpm-132- (72)vrf;-o&zDvrf;oG,f-ref;wav;/



reported by--------------------su nyein nyein chan

name ----Prof. U Hla Myint(retired),

NR no.- -9/ma ya ma(naing)050285

Address—132,72 st.,tha ra fi lane, Mandalay.







@@@@@@@@@@@@@@@@@@@@@@@@@@@
For sale: Nagging wife, some rust

Published: 13/03/2009 at 10:51 AM

LONDON - A British man fed up with his wife's complaints advertised her for sale -- and received a number of offers.



"Nagging Wife. No Tax, No MOT. Very high maintenance -- some rust," wrote Gary Bates, 38, in a small ad in Trade-It, more usually used to buy and sell cars or household goods.



Mr Bates, a self-employed builder from Gloucestershire, southwest England, snapped after his wife Donna scolded him while she sat watching television, and he decided to place the ad as a joke.



"She was nagging me for doing something small, while she was watching some rubbish on TV. So I just thought I'd put an ad in to get rid of her.



"I didn't think anyone would ring up but I've had at least nine or 10 people calling about her. It's gone mad. There was no one I knew -- just people asking, 'Is she still available?'"



The couple married only last year, and Mr Bates said his 40-year-old wife -- whom he advertised in the magazine's Free to Collect section, along with some of his fishing tackle -- initially gave him "a bit of an ear-bashing".





nagging(v) to be a persistent cause of discomfort, anxiety, or unease.

tjrJ*sD usaeaom

Tuesday, November 24, 2009

10 days experience @ kyaukse computer university.

10 days experience @ kyaukse computer university
dear aunty shwe zin u 1961,



i am now 10 days @ kyauk seဲ computer university(ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ).

i have to ride about 20 miles to the university;

sometimes ,if i do not get a seat, i have to stand the whole journey ;

i feel very exhausted when i got at my class room ;

buildings are very big and lovely.

we have a very grand convocation Hall.

but we do not have canteen in our university compound.



we do not have trees and flower gardens;

when i was in High School, i used to dream of beautiful flowers and big trees and beautiful lakes (like Inya lake);

i dream to walk around with my friends in beautiful flower gardens.

we have many teachers;

most of them are Ph.Ds!

we are very proud of them ;

but we are not very happy to wear university uniforms;

we want to wear trendy dress (especially jeans);

we are not allowed to do that; very bad? don't u think so?



dear aunty ,my grandfather and uncle u win said you are a good writer;

u read a lot;

but unfortunately u read cartoons!

please write ur stories on

my grandpa's site;

i am very eager to read ur stories.





with best wishes

ကြန္ျပူတာမ ယ္သစ္လြင္စုျငိမ္းျငိမ္းခ်မ္း

(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)

ုkyauk se university



sunyeinnyeinchan@gmail.com,

sunyeinnyeinchan@nolimitmail.com.


http://groups.google.com/group/cherryagrochemicals,

http://groups.google.com/group/Mandalay-University-Family-2006,

http://groups.google.com/group/Shwe/TimeWarpedGoldenLand,

http://groups.google.com/group/DefenceServicesTechnologicalFamily.





cherryagrochemicals@googlegroups.com,

Mandalay-University-Family-2006@googlegroups.com ,

Shwe/TimeWarpedGoldenLand@googlegroups.com,

DefenceServicesTechnologicalFamily@googlegroups.com .




http://sites.google.com/site/nyeinchan28/Home;

http://sites.google.com;



http://sites.google.com/site/mandalayuniversityfamily2009/home.

http://shwezinu.blogspot.com/2009_08_10_archive.html

Sunday, November 22, 2009

computer fresher sunyeinnyeinchan(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)

sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.

from mandalay with love,
23 nov. 2009

dear u myo khin,


i am now 10 days @ kyau se computer university(ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ).
i have to ride about 20 miles to the university;sometimes ,if i do not get a seat, i have to stand the whole journey ; i feel very exhausted when i got at my class room ;
buildings are very big and lovely.
we have a very grand convocation Hall.
we do not have canteen in our university compound.

we do not have trees and flower gardens;
when i was in High School, i used to dream of beautiful flowers and big trees and beautiful lakes (like Inya lake); i dream to walk around with my friends in beautiful flower gardens.
we have many teachers; most of them are Ph.Ds.
we are very proud of them and to wear university uniforms;

dear u myo khin ,my grandfather said you are a good story teller.
please write ur story about
"pa oa robbers " ပအို ့ဒါးျပ ဇာတ္လမ္း on my grandpa's site;
i am very eager to read ur stories.


with best wishes
ကြန္ျပူတာမ ယ္သစ္လြင္စုျငိမ္းျငိမ္းခ်မ္း
(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)
ုkyauk se university

sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.

http://groups.google.com/group/cherryagrochemicals,

http://groups.google.com/group/Mandalay-University-Family-2006,

http://groups.google.com/group/Shwe/TimeWarpedGoldenLand,

http://groups.google.com/group/DefenceServicesTechnologicalFamily.





cherryagrochemicals@googlegroups.com,

Mandalay-University-Family-2006@googlegroups.com ,

Shwe/TimeWarpedGoldenLand@googlegroups.com,

DefenceServicesTechnologicalFamily@googlegroups.com .

http://sites.google.com/site/nyeinchan28/Home;

http://sites.google.com;



http://sites.google.com/site/mandalayuniversityfamily2009/home.

http://shwezinu.blogspot.com/2009_08_10_archive.html
http://nyeinchansarpay.blogspot.com

Saturday, November 21, 2009

m file to learn matlab

% m file to learn matlab
%nwe nwe htay
%Example 5.
%The following code generates sine and cosine curves,
%then samples the splines over a finer mesh.
%21 nov. 2009


x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'o',xx,YY(2,:),':'); hold off;

4 examples to learn data anaylysis

4 examples to learn data anaylysis
Nwe nwe htay
Saturday, November 21, 2009

MATLAB Function Reference spline


Cubic spline data interpolation

Syntax

pp = spline(x,Y)
yy = spline(x,Y,xx)



Description


pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.

yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].

Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)

Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.

Examples


Example 1. This generates a sine curve, then samples the spline over a finer mesh.

x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)





Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.

x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');





Example 3. The two vectors

t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];



represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression

spline(t,p,2000)



uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060



Example 4. The statements

x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal



generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.



Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.

x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'o',xx,YY(2,:),':'); hold off;





Algorithm


A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.

See Also


interp1, ppval, mkpp, pchip, unmkpp

References


[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.




spinmap spones

© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks

4 examples to learn data anaylysis

4 examples to learn data anaylysis
Nwe nwe htay
Saturday, November 21, 2009

MATLAB Function Reference spline


Cubic spline data interpolation

Syntax

pp = spline(x,Y)
yy = spline(x,Y,xx)



Description


pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.

yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].

Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)

Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.

Examples


Example 1. This generates a sine curve, then samples the spline over a finer mesh.

x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)





Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.

x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');





Example 3. The two vectors

t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];



represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression

spline(t,p,2000)



uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060



Example 4. The statements

x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal



generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.



Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.

x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'o',xx,YY(2,:),':'); hold off;





Algorithm


A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.

See Also


interp1, ppval, mkpp, pchip, unmkpp

References


[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.




spinmap spones

© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks

Cubic spline data analysis.

%this program is useful to learn matlab.
%nwe nwe htay learning matlab 11 no.2009
%5:53:34 AM

%load('K:\matlab.mat')
%Example 5. The following code generates sine and cosine curves,
%then samples the splines over a finer mesh.

x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'oY
0 0.2474 0.4794 0.6816 0.8415
1.0000 0.9689 0.8776 0.7317 0.5403
Y(1,:) %GENERATING 1 st. row.

%ans =
0 0.2474 0.4794 0.6816 0.8415
Y(:,5) %generting 5 th. column.
%ans =
% 0.8415
% 0.5403
Y %generating matrix y
%Y =
% 0 0.2474 0.4794 0.6816 0.8415
% 1.0000 0.9689 0.8776 0.7317 0.5403
Y(2,5) %element(2,5)
%ans =
% 0.5403
%Y(2,3)
%ans =
% 0.8776

Cubic spline data interpolation

Nwe nwe htay
Saturday, November 21, 2009

MATLAB Function Reference spline


Cubic spline data interpolation

Syntax

pp = spline(x,Y)
yy = spline(x,Y,xx)



Description


pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.

yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].

Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)

Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.

Examples


Example 1. This generates a sine curve, then samples the spline over a finer mesh.

x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)





Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.

x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');





Example 3. The two vectors

t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];



represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression

spline(t,p,2000)



uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060



Example 4. The statements

x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal



generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.



Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.

x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'o',xx,YY(2,:),':'); hold off;





Algorithm


A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.

See Also


interp1, ppval, mkpp, pchip, unmkpp

References


[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.




spinmap spones

© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks

Sunday, November 1, 2009

Saturday, October 31, 2009

matlab short notes /1 nov. 2009

%matlab short notes 25 March 2009
Getting Started
Expressions
Like most other programming languages, MATLAB provides mathematical expressions, but unlike most programming languages, these expressions involve entire matrices. The building blocks of expressions are Variables
Numbers
Operators
Functions
See also Examples of Expressions.

Variables


MATLAB does not require any type declarations or dimension statements. When MATLAB encounters a new variable name, it automatically creates the variable and allocates the appropriate amount of storage. If the variable already exists, MATLAB changes its contents and, if necessary, allocates new storage. For example,
num_students = 25
creates a 1-by-1 matrix named num_students and stores the value 25 in its single element.
Variable names consist of a letter, followed by any number of letters, digits, or underscores. MATLAB uses only the first 31 characters of a variable name. MATLAB is case sensitive; it distinguishes between uppercase and lowercase letters. A and a are not the same variable. To view the matrix assigned to any variable, simply enter the variable name.
Wednesday, March 25, 2009
Numbers
MATLAB uses conventional decimal notation, with an optional decimal point and leading plus or minus sign, for numbers. Scientific notation uses the letter e to specify a power-of-ten scale factor. Imaginary numbers use either i or j as a suffix. Some examples of legal numbers are
3 -99 0.0001
9.6397238 1.60210e-20 6.02252e23
1i -3.14159j 3e5i
All numbers are stored internally using the long format specified by the IEEE floating-point standard. Floating-point numbers have a finite precision of roughly 16 significant decimal digits and a finite range of roughly 10-308 to 10+308.
Operators
Expressions use familiar arithmetic operators and precedence rules.

+ Addition-Subtraction
*Multiplication/Division
\Left division (described in "Matrices and Linear Algebra" in the MATLAB documentation)
^Power'Complex conjugate transpose
( )Specify evaluation order
ting Started

Functions
MATLAB provides a large number of standard elementary mathematical functions, including abs, sqrt, exp, and sin. Taking the square root or logarithm of a negative number is not an error; the appropriate complex result is produced automatically. MATLAB also provides many more advanced mathematical functions, including Bessel and gamma functions. Most of these functions accept complex arguments. For a list of the elementary mathematical functions, type
help elfun
For a list of more advanced mathematical and matrix functions, type
help specfun
help elmat


Some of the functions, like sqrt and sin, are built in. Built-in functions are part of the MATLAB core so they are very efficient, but the computational details are not readily accessible. Other functions, like gamma and sinh, are implemented in M-files. There are some differences between built-in functions and other functions. For example, for built-in functions, you cannot see the code. For other functions, you can see the code and even modify it if you want.
Several special functions provide values of useful constants.
pi3.14159265...iImaginary unit, jSame as iepsFloating-point relative precision, realmin Smallest floating-point number, realmaxLargest floating-point number, InfInfinityNaNNot-a-number

Infinity is generated by dividing a nonzero value by zero, or by evaluating well defined mathematical expressions that overflow, i.e., exceed realmax. Not-a-number is generated by trying to evaluate expressions like 0/0 or Inf-Inf that do not have well defined mathematical values.
The function names are not reserved. It is possible to overwrite any of them with a new variable, such as
eps = 1.e-6
and then use that value in subsequent calculations. The original function can be restored with
clear eps
Wednesday, March 25, 2009
Examples of Expressions
You have already seen several examples of MATLAB expressions. Here are a few more examples, and the resulting values:
rho = (1+sqrt(5))/2
rho =
1.6180
a = abs(3+4i)
a =
5

z = sqrt(besselk(4/3,rho-i))
z =
0.3730+ 0.3214i
huge = exp(log(realmax))
huge =
1.7977e+308
toobig = pi*huge
toobig =
Inf
Wednesday, March 25, 2009
Starting MATLAB
On Windows platforms, start MATLAB by double-clicking the MATLAB shortcut icon on your Windows desktop.

On UNIX platforms, start MATLAB by typing matlab at the operating system prompt.
You can customize MATLAB startup. For example, you can change the directory in which MATLAB starts or automatically execute MATLAB statements in a script file named startup.m.
Thursday, March 26, 2009
5:59 AM
Noise
Noise is considered to be any measurement that is not part of the phenomena of interest. Noise can be generated within the electrical components of the input amplifier (internal noise), or it can be added to the signal as it travels down the input wires to the amplifier (external noise). Techniques that you can use to reduce the effects of noise are described below.
Configure the input channels in differential mode. Refer to Channel Configuration for more information about channel configuration. Use signal wires that are twisted together rather than separate. Keep the signal wires as short as possible. Keep the signal wires as far away as possible from environmental electrical activity.


Filtering

Filtering also reduces signal noise. For many data acquisition applications, a low-pass filter is beneficial. As the name suggests, a low-pass filter passes the lower frequency components but attenuates the higher frequency components. The cut-off frequency of the filter must be compatible with the frequencies present in the signal of interest and the sampling rate used for the A/D conversion.

A low-pass filter that's used to prevent higher frequencies from introducing distortion into the digitized signal is known as an antialiasing filter if the cut-off occurs at the Nyquist frequency. That is, the filter removes frequencies greater than one-half the sampling frequency. These filters generally have a sharper cut-off than the normal low-pass filter used to condition a signal. Antialiasing filters are specified according to the sampling rate of the system and there must be one filter per input signal.
Communications Toolbox
White Gaussian Noise
The wgn function generates random matrices using a white Gaussian noise distribution. You specify the power of the noise in either dBW (decibels relative to a watt), dBm, or linear units. You can generate either real or complex noise.
For example, the command below generates a column vector of length 50 containing real white Gaussian noise whose power is 2 dBW. The function assumes that the load impedance is 1 ohm.
y1 = wgn(50,1,2);
To generate complex white Gaussian noise whose power is 2 Watts, across a load of 60 ohms, use either of the commands below. Notice that the ordering of the string inputs does not matter.
y2 = wgn(50,1,2,60,'complex','linear');
y3 = wgn(50,1,2,60,'linear','complex');
To send a signal through an additive white Gaussian noise channel, use the awgn function. See AWGN Channel for more information.


Imnoise


Add noise to an image
Syntax
J = imnoise(I,type)
J = imnoise(I,type,parameters)
Description
J = imnoise(I,type) adds noise of a given type to the intensity image I. type is a string that can have one of these values.
Value Description
'gaussian' Gaussian white noise with constant mean and variance
'localvar' Zero-mean Gaussian white noise with an intensity-dependent variance
'poisson' Poisson noise
'salt & pepper' On and off pixels
'speckle' Multiplicative noise.
Depending on which type of noise you specify, imnoise accepts additional parameters. If you omit these arguments, imnoise uses default values for the parameters. All numerical parameters are normalized; they correspond to operations with images with intensities ranging from 0 to 1.
J = imnoise(I,'gaussian',m,v) adds Gaussian white noise of mean m and variance v to the image I. The default is zero mean noise with 0.01 variance.

J = imnoise(I,'localvar',V) adds zero-mean, Gaussian white noise of local variance V to the image I. V is an array of the same size as I.

J = imnoise(I,'localvar',image_intensity,var) adds zero-mean, Gaussian noise to an image I, where the local variance of the noise, var, is a function of the image intensity values in I. The image_intensity and var arguments are vectors of the same size, and plot(image_intensity,var) plots the functional relationship between noise variance and image intensity. The image_intensity vector must contain normalized intensity values ranging from 0 to 1.

J = imnoise(I,'poisson') generates Poisson noise from the data instead of adding artificial noise to the data. In order to respect Poisson statistics, the intensities of unit8 and uint16 images must correspond to the number of photons (or any other quanta of information). Double-precision images are used when the number of photons per pixel can be much larger than 65535 (but less than 10^12); the intensity values vary between 0 and 1 and correspond to the number of photons divided by 10^12.

J = imnoise(I,'salt & pepper',d) adds salt and pepper noise to the image I, where d is the noise density. This affects approximately d*prod(size(I)) pixels. The default is 0.05 noise density.

J = imnoise(I,'speckle',v) adds multiplicative noise to the image I, using the equation J = I+n*I, where n is uniformly distributed random noise with mean 0 and variance v. The default for v is 0.04.

Note The mean and variance parameters for 'gaussian', 'localvar', and 'speckle' noise types are always specified as if the image were of class double in the range [0, 1]. If the input image is of class uint8 or uint16, the imnoise function converts the image to double, adds noise according to the specified type and parameters, and then converts the noisy image back to the same class as the input.

Class Support
I can be of class uint8, uint16, int16, single, or double. The output image J is of the same class as I. If I has more than two dimensions it is treated as a multidimensional intensity image and not as an RGB image.
Example
I = imread('eight.tif');
J = imnoise(I,'salt & pepper',0.02);
imshow(I)
figure, imshow(J)


%Example
I = imread('eight.tif');
J = imnoise(I,'salt & pepper',0.02);
imshow(I)
figure, imshow(J)
%is this creation
%Example
I = imread('eight.tif');
J = imnoise(I,'salt & pepper',0.02);
imshow(I)
figure, imshow(J)
%'gaussian' %Gaussian white noise with constant mean and variance
%'localvar' %Zero-mean Gaussian white noise with an intensity-dependent variance
%'poisson' %Poisson noise
%'salt & pepper %On and off pixels
%'speckle' %Multiplicative noise.
I = imread('eight.tif');
>> plot(I) %image is observed;
%is this creation on noise 27 march 09.
%I %1 original numerical data
%plot(I) %2 graph form of original data
%imshow(I) %3 picture form of original data
%figure, imshow(I) %4 ******

%J %1n noised numerical data
%plot(J) %2n graph form of noised data
%imshow(J) %3n picture form of noised data
%figure, imshow(J) %4n ******


%Example
I = imread('eight.tif'); %original image,coin
J = imnoise(I,'salt & pepper',0.02); %adding noise
w=imread(‘YellowHlaMyintWin0012’) %Hla myint win
??? w=imread(‘YellowHlaMyintWin0012’) %Hla myint win
|
Error: The input character is not valid in MATLAB statements or expressions.

%I %1 original numerical data
%plot(I) %2 graph form of original data
%imshow(I) %3 picture form of original data
%figure, imshow(I) %4 ******

%J %1n noised numerical data
%plot(J) %2n graph form of noised data
%imshow(J) %3n picture form of noised data
%figure, imshow(J) %4n ******

Friday, March 27, 2009
%colon operator creation 27 march 09.

A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1];
1:10;
%is a row vector containing the integers from 1 to 10:
%1 2 3 4 5 6 7 8 9 10
%To obtain nonunit spacing, specify an increment. For example,
100:-7:50
%is
%100 93 86 79 72 65 58 51
%and
%0:pi/4:pi
%is
%0 0.7854 1.5708 2.3562 3.1416
%Subscript expressions involving colons refer to portions of a matrix:
%A(1:k,j)
%is the first k elements of the jth column of A. So
%sum(A(1:4,4))
%computes the sum of the fourth column. But there is a better way. The colon by itself refers to all the elements in a row or column of a matrix and the keyword end refers to the last row or column. So
sum(A(:,end))
%computes the sum of the elements in the last column of A
To make this B into Dürer's A, swap the two middle columns:
A = B(:,[1 3 2 4]) %swapping colon 2 & 3 of B
3/27/2009 1:50 PM
N = fix(10*rand(1,10))

N =

9 2 6 4 8 7 4 0 8 4




Generating Matrices


MATLAB provides four functions that generate basic matrices.

Zeros All zeros
Ones All ones
Rand Uniformly distributed random elements
randn Normally distributed random elements.


Here are some examples:
Z = zeros(2,4)
Z =
0 0 0 0
0 0 0 0

F = 5*ones(3,3)
F =
5 5 5
5 5 5
5 5 5

N = fix(10*rand(1,10))
N =
9 2 6 4 8 7 4 0 8 4

R = randn(4,4)
R =
0.6353 0.0860 -0.3210 -1.2316
-0.6014 -2.0046 1.2366 1.0556
0.5512 -0.4931 -0.6313 -0.1132
-1.0998 0.4620 -2.3252 0.3792

3/27/2009 2:26 PM

Getting Started

The load Function (NOT successful)


The load function reads binary files containing matrices generated by earlier MATLAB sessions, or reads text files containing numeric data. The text file should be organized as a rectangular table of numbers, separated by blanks, with one row per line, and an equal number of elements in each row. For example, outside of MATLAB, create a text file containing these four lines:
16.0 3.0 2.0 13.0
5.0 10.0 11.0 8.0
9.0 6.0 7.0 12.0
4.0 15.0 14.0 1.0
Store the file under the name magik.dat. Then the statement
load magik.dat
reads the file and creates a variable, magik, containing our example matrix.
An easy way to read data into MATLAB in many text or binary formats is to use Import Wizard.
Load function not successful
3/27/2009 3:42 PM
Getting Started
More About Matrices and Arrays
This section shows you more about working with matrices and arrays, focusing on Linear Algebra Arrays Multivariate Data Scalar Expansion Logical Subscripting The find Function
Linear Algebra
Informally, the terms matrix and array are often used interchangeably. More precisely, a matrix is a two-dimensional numeric array that represents a linear transformation. The mathematical operations defined on matrices are the subject of linear algebra. Dürer's magic square
A = [16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1 ]
provides several examples that give a taste of MATLAB matrix operations. You have already seen the matrix transpose, A'. Adding a matrix to its transpose produces a symmetric matrix:
A + A'

ans =
32 8 11 17
8 20 17 23
11 17 14 26
17 23 26 2

The multiplication symbol, *, denotes the matrix multiplication involving inner products between rows and columns. Multiplying the transpose of a matrix by the original matrix also produces a symmetric matrix:
A'*A
ans =
378 212 206 360
212 370 368 206
206 368 370 212
360 206 212 378
The determinant of this particular matrix happens to be zero, indicating that the matrix is singular:
d = det(A)

d =
0
The reduced row echelon form of A is not the identity:
R = rref(A)
R =
1 0 0 1
0 1 0 -3
0 0 1 3
0 0 0 0
Since the matrix is singular, it does not have an inverse. If you try to compute the inverse with
X = inv(A)
you will get a warning message:
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 9.796086e-018.
Roundoff error has prevented the matrix inversion algorithm from detecting exact singularity. But the value of rcond, which stands for reciprocal condition estimate, is on the order of eps, the floating-point relative precision, so the computed inverse is unlikely to be of much use.
The eigenvalues of the magic square are interesting:
e = eig(A)

e =
34.0000
8.0000
0.0000
-8.0000

One of the eigenvalues is zero, which is another consequence of singularity. The largest eigenvalue is 34, the magic sum. That is because the vector of all ones is an eigenvector:
v = ones(4,1)

v =
1
1
1
1

A*v

ans =
34
34
34
34
When a magic square is scaled by its magic sum,
P = A/34
the result is a doubly stochastic matrix whose row and column sums are all 1:
P =
0.4706 0.0882 0.0588 0.3824
0.1471 0.2941 0.3235 0.2353
0.2647 0.1765 0.2059 0.3529
0.1176 0.4412 0.4118 0.0294



Such matrices represent the transition probabilities in a Markov process. Repeated powers of the matrix represent repeated steps of the process. For our example, the fifth power
P^5
is
0.2507 0.2495 0.2494 0.2504
0.2497 0.2501 0.2502 0.2500
0.2500 0.2498 0.2499 0.2503
0.2496 0.2506 0.2505 0.2493

This shows that as k approaches infinity, all the elements in the kth power,p^k , approach 1/4.
Finally, the coefficients in the characteristic polynomial
poly(A)
are
1 -34 -64 2176 0
This indicates that the characteristic polynomial
*******************************************
The constant term is zero, because the matrix is singular, and the coefficient of the cubic term is -34, because the matrix is magic!.
Arrays
When they are taken away from the world of linear algebra, matrices become two-dimensional numeric arrays. Arithmetic operations on arrays are done element by element. This means that addition and subtraction are the same for arrays and matrices, but that multiplicative operations are different. MATLAB uses a dot, or decimal point, as part of the notation for multiplicative array operations.
The list of operators includes
+ Addition
- Subtraction
.* Element-by-element multiplication
./ Element-by-element division.
\ Element-by-element left division
.^ Element-by-element power
.' Unconjugated array transpose
A = [16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1 ] % Dürer magic square
If the Dürer magic square is multiplied by itself with array multiplication
A.*A
the result is an array containing the squares of the integers from 1 to 16, in an unusual order:
ans =
256 9 4 169
25 100 121 64
81 36 49 144
16 225 196 1
Building Tables
Array operations are useful for building tables. Suppose n is the column vector
n = (0:9)';
Then
pows = [n n.^2 2.^n]
builds a table of squares and powers of 2:
pows =
0 0 1
1 1 2
2 4 4
3 9 8
4 16 16
5 25 32
6 36 64
7 49 128
8 64 256
9 81 512


he elementary math functions operate on arrays element by element. So
format short g
x = (1:0.1:2)';
logs = [x log10(x)]
builds a table of logarithms.
logs =
1.0 0
1.1 0.04139
1.2 0.07918
1.3 0.11394
1.4 0.14613
1.5 0.17609
1.6 0.20412
1.7 0.23045
1.8 0.25527
1.9 0.27875
2.0 0.30103
3/27/2009 9:29 PM
To contd. Getting started-matrices and arrays-more about matrices-arrays
6/12/2009 3:42 AM
Multivariate Data
MATLAB uses column-oriented analysis for multivariate statistical data. Each column in a data set represents a variable and each row an observation. The (i,j)th element is the ith observation of the jth variable.
As an example, consider a data set with three variables:
Heart rate
Weight
Hours of exercise per week
For five observations, the resulting array might look like
D = [ 72 134 3.2
81 201 3.5
69 156 7.1
82 148 2.4
75 170 1.2 ]
The first row contains the heart rate, weight, and exercise hours for patient 1, the second row contains the data for patient 2, and so on.

Now you can apply many MATLAB data analysis functions to this data set. For example, to obtain the mean and standard deviation of each column, use
mu = mean(D), sigma = std(D)

mu =
75.8 161.8 3.48
sigma =
5.6303 25.499 2.2107
For a list of the data analysis functions available in MATLAB, type
help datafun
If you have access to the Statistics Toolbox, type
help stats
6/12/2009 3:42 AM
Scalar Expansion
Matrices and scalars can be combined in several different ways. For example, a scalar is subtracted from a matrix by subtracting it from each element. The average value of the elements in our magic square is 8.5, so
B = A - 8.5
forms a matrix whose column sums are zero:
B =
7.5 -5.5 -6.5 4.5
-3.5 1.5 2.5 -0.5
0.5 -2.5 -1.5 3.5
-4.5 6.5 5.5 -7.5
sum(B) % column sums
ans =
0 0 0 0
With scalar expansion, MATLAB assigns a specified scalar to all indices in a range. For example,
B(1:2,2:3) = 0 % elements in 1st row. & 2nd row. AND 2nd column & 3rd column

zeroes out a portion of B:
B =
7.5 0 0 4.5
-3.5 0 0 -0.5
0.5 -2.5 -1.5 3.5
-4.5 6.5 5.5 -7.5
B(1:2,2:3)=16; % elements in 1st row. & 2nd row. AND 2nd column
& 3rd column
>> B
B =

7.5000 16.0000 16.0000 4.5000
-3.5000 16.0000 16.0000 -0.5000
0.5000 -2.5000 -1.5000 3.5000
-4.5000 6.5000 5.5000 -7.5000
Amen amen amen6/12/2009 3:42 AM


Controlling Command Window Input and Output
So far, you have been using the MATLAB command line, typing functions and expressions, and seeing the results printed in the Command Window. This section describes The format Function Suppressing Output Entering Long Statements Command Line Editing
The format Function
The format function controls the numeric format of the values displayed by MATLAB. The function affects only how numbers are displayed, not how MATLAB computes or saves them. Here are the different formats, together with the resulting output produced from a vector x with components of different magnitudes.
Note To ensure proper spacing, use a fixed-width font, such as Courier.
x = [4/3 1.2345e-6]
format short
1.3333 0.0000
format short e
1.3333e+000 1.2345e-006
format short g
1.3333 1.2345e-006
format long
1.33333333333333 0.00000123450000
format long e
1.333333333333333e+000 1.234500000000000e-006
format long g
1.33333333333333 1.2345e-006
format bank
1.33 0.00
format rat
4/3 1/810045
format hex
3ff5555555555555 3eb4b6231abfd271
If the largest element of a matrix is larger than 103 or smaller than 10-3, MATLAB applies a common scale factor for the short and long formats.
In addition to the format functions shown above
format compact
suppresses many of the blank lines that appear in the output. This lets you view more information on a screen or window. If you want more control over the output format, use the sprintf and fprintf functions.
Amen amen amen3/28/2009 8:35 AM
Next---suppressing output
Sunday, March 29, 2009
double-click
vb. To press and release a mouse button twice without moving the mouse. Double-clicking is a means of rapidly selecting and activating a program or program feature. Compare click, drag.
Suppressing Output
If you simply type a statement and press Return or Enter, MATLAB automatically displays the results on screen. However, if you end the line with a semicolon, MATLAB performs the computation but does not display any output. This is particularly useful when you generate large matrices. For example,
A = magic(100);
Entering Long Statements
If a statement does not fit on one line, use an ellipsis (three periods), ..., followed by Return or Enter to indicate that the statement continues on the next line. For example,
s = 1 -1/2 + 1/3 -1/4 + 1/5 - 1/6 + 1/7 ...
- 1/8 + 1/9 - 1/10 + 1/11 - 1/12;
Blank spaces around the =, +, and - signs are optional, but they improve readability.
Sunday, March 29, 2009
Examples -- Using MATLAB Plotting Tools
Suppose you want to graph the function y = x3 over the x domain -1 to 1. The first step is to generate the data to plot.
It is simple to evaluate a function because MATLAB can distribute arithmetic operations over all elements of a multivalued variable.
For example, the following statement creates a variable x that contains values ranging from -1 to 1 in increments of 0.1 (you could also use the linspace function to generate data for x). The second statement raises each value in x to the third power and stores these values in y:
x = -1:.1:1; % Define the range of x
y = x.^3; % Raise each element in x to the third power
Now that you have generated some data, you can plot it using the MATLAB plotting tools. To start the plotting tools, type
plottools
MATLAB displays a figure with plotting tools attached


Plotting Two Variables
A simple line graph is a suitable way to display x as the independent variable and y as the dependent variable. To do this, select both variables (click to select, then Shift-click to select again), then right-click to display the context menu.
Select plot(x,y) from the menu. MATLAB creates the line graph in the figure area. The black squares indicate that the line is selected and you can edit its properties with the Property Editor.
To contd.-Getting started-GRAPHICS
3/30/2009 3:12 AM
Case Study: Curve Fitting
This section provides an overview of some of the MATLAB basic data analysis capabilities in the form of a case study. The examples that follow work with a collection of census data, using MATLAB functions to experiment with fitting curves to the data: Polynomial fit
Analyzing residuals
Exponential fit Error bounds
This section also tells you how to use the Basic Fitting interface to perform curve fitting tasks.
Loading the Data
The file census.mat contains U.S. population data for the years 1790 through 1990. Load it into MATLAB:
load census
Your workspace now contains two new variables, cdate and pop: cdate is a column vector containing the years from 1790 to 1990 in increments of 10. pop is a column vector with the U.S. population figures that correspond to the years in cdate.
Polynomial Fit
A first try in fitting the census data might be a simple polynomial fit. Two MATLAB functions help with this process.
Curve Fitting Function Summary
Function Description
Polyfit Polynomial curve fit.
Polyval Evaluation of polynomial fit.

The MATLAB polyfit function generates a "best fit" polynomial (in the least squares sense) of a specified order for a given set of data. For a polynomial fit of the fourth-order
p = polyfit(cdate,pop,4)
Warning: Polynomial is badly conditioned. Remove repeated data
points or try centering and scaling as described in HELP POLYFIT.
p =
1.0e+05 *

0.0000 -0.0000 0.0000 -0.0126 6.0020

The warning arises because the polyfit function uses the cdate values as the basis for a matrix with very large values (it creates a Vandermonde matrix in its calculations - see the polyfit M-file for details). The spread of the cdate values results in scaling problems. One way to deal with this is to normalize the cdate data.
Preprocessing: Normalizing the Data
Normalization is a process of scaling the numbers in a data set to improve the accuracy of the subsequent numeric computations. A way to normalize cdate is to center it at zero mean and scale it to unit standard deviation:
sdate = (cdate - mean(cdate))./std(cdate)
Now try the fourth-degree polynomial model using the normalized data:
p = polyfit(sdate,pop,4)
p =
0.7047 0.9210 23.4706 73.8598 62.2285
Evaluate the fitted polynomial at the normalized year values, and plot the fit against the observed data points:
pop4 = polyval(p,sdate);
plot(cdate,pop4,'-',cdate,pop,'+'), grid on
amen amen amen3/30/2009 4:25 AM


Analyzing Residuals
A measure of the "goodness" of fit is the residual, the difference between the observed and predicted data. Compare the residuals for the various fits, using normalized cdate values. It's evident from studying the fit plots and residuals that it should be possible to do better than a simple polynomial fit with this data set.
%fit
p1 = polyfit(sdate,pop,1);
pop1 = polyval(p1,sdate);
plot(cdate,pop1,'b-',cdate,pop,'g+')
%residuals
res1 = pop - pop1;
figure, plot(cdate,res1,'g+')
%fit
p = polyfit(sdate,pop,4);
pop4 = polyval(p,sdate);
plot(cdate,pop4,'b-',cdate,pop,'g+');
%residual
res4 = pop - pop4;
figure, plot(cdate,res4,'g+');
amen amen amen 3/30/2009 4:48 AM
Sunday, April 05, 2009 2:46 PM
ommunications Toolbox
Convolution
This toolbox offers two equivalent ways to convolve a pair of Galois vectors:
Use the conv function, as described in Multiplication and Division of Polynomials. This works because convolving two vectors is equivalent to multiplying the two polynomials whose coefficients are the entries of the vectors.

Use the convmtx function to compute the convolution matrix of one of the vectors, and then multiply that matrix by the other vector. This works because convolving two vectors is equivalent to filtering one of the vectors by the other. The equivalence permits the representation of a digital filter as a convolution matrix, which you can then multiply by any Galois vector of appropriate length.
Tip If you need to convolve large Galois vectors, then multiplying by the convolution matrix might be faster than using conv.
Example
The example below computes the convolution matrix for a vector b in GF(4), representing the numerator coefficients for a digital filter. It then illustrates the two equivalent ways to convolve b with x over the Galois field.
m = 2; b = gf([1 2 3]',m);
n = 3; x = gf(randint(n,1,2^m),m);
C = convmtx(b,n); % Compute convolution matrix.
v1 = conv(b,x); % Use conv to convolve b with x
v2 = C*x; % Use C to convolve b with x.
%outputs
>> v1

v1 = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

3
1
0
3
1

>> v2

v2 = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

3
1
0
3
1
%very good v1=v2 QED
Amen amen amen Sunday, April 05, 2009
ATLAB Function Reference
Polynomials
Conv Convolution and polynomial multiplication
Deconv Deconvolution and polynomial division
Poly Polynomial with specified roots
Polyder Polynomial derivative
Polyeig Polynomial eigenvalue problem
Polyfit Polynomial curve fitting
Polyint Analytic polynomial integration
Polyval Polynomial evaluation
Polyvalm Matrix polynomial evaluation
Residue Convert between partial fraction expansion and polynomial coefficients
Roots Polynomial roots

Data Analysis and Fourier Transforms Interpolation and Computational Geometry

%polyder
%Polynomial derivative
%5 april 09

Syntax

k = polyder(p)
k = polyder(a,b)
[q,d] = polyder(b,a)
Description
%The polyder function calculates the derivative of polynomials,
%polynomial products, and polynomial quotients.
%The operands a, b, and p are vectors whose elements are the coefficients
%of a polynomial in descending powers.

k = polyder(p) returns the derivative of the polynomial p.

k = polyder(a,b) returns the derivative of the product of the polynomials a and b.

[q,d] = polyder(b,a) returns the numerator q and denominator d of the derivative
of the polynomial quotient b/a.
Examples
%The derivative of the product is obtained with
a = [3 6 9];
b = [1 2 0];
k = polyder(a,b)
k =
12 36 42 18

products
>> %The derivative of the product is obtained with
a = [3 6 9];
b = [1 2 0];
k = polyder(a,b)

k =

12 36 42 18

>>
Monday, April 06, 2009

mage Processing Toolbox User's Guide

Convolution


Linear filtering of an image is accomplished through an operation called convolution. Convolution is a neighborhood operation in which each output pixel is the weighted sum of neighboring input pixels. The matrix of weights is called the convolution kernel, also known as the filter. A convolution kernel is a correlation kernel that has been rotated 180 degrees.

For example, suppose the image is
A = [17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9]



and the convolution kernel is
h = [8 1 6
3 5 7
4 9 2]
Amen
%Mathematics

%Convolution and Deconvolution
%3 april 09
%Polynomial multiplication and division correspond to
%the operations convolution and deconvolution.
%The functions conv and deconv implement these operations.

%Consider the polynomials -- and--- . To compute their product,
a = [1 2 3]; b = [4 5 6];
c = conv(a,b)

%c =
% 4 13 28 27 18

%Use deconvolution to divide back out of the product.
%[q,r] = deconv(c,a)

%q =
% 4 5 6

%r =
% 0 0 0 0 0
% outputs

To get started, select MATLAB Help or Demos from the Help menu.

>> %Consider the polynomials -- and--- . To compute their product,
a = [1 2 3]; b = [4 5 6];
c = conv(a,b)

%c =
% 4 13 28 27 18

%Use deconvolution to divide back out of the product.
%[q,r] = deconv(c,a)

c =

4 13 28 27 18

>> [q,r] = deconv(c,a)

q =

4 5 6


r =

0 0 0 0 0
Monday, April 06, 2009 3:40 PM
Image Processing Toolbox User's Guide
Linear Filtering and Filter Design
The Image Processing Toolbox provides a number of functions for designing and implementing two-dimensional linear filters for image data. This chapter describes these functions and how to use them effectively. Linear FilteringProvides an explanation of linear filtering and how it is implemented in the toolbox. This topic describes filtering in terms of the spatial domain, and is accessible to anyone doing image processing.Filter DesignDiscusses designing two-dimensional finite impulse response (FIR) filters. This section assumes you are familiar with working in the frequency domain.


Image Processing Toolbox User's Guide
Linear Filtering
Filtering is a technique for modifying or enhancing an image. For example, you can filter an image to emphasize certain features or remove other features. Image processing operations implemented with filtering include smoothing, sharpening, and edge enhancement.

Filtering is a neighborhood operation, in which the value of any given pixel in the output image is determined by applying some algorithm to the values of the pixels in the neighborhood of the corresponding input pixel. A pixel's neighborhood is some set of pixels, defined by their locations relative to that pixel. (See Neighborhood and Block Operations, for a general discussion of neighborhood operations.)

Linear filtering is filtering in which the value of an output pixel is a linear combination of the values of the pixels in the input pixel's neighborhood.

This section discusses linear filtering in MATLAB and the Image Processing Toolbox. It includes
A description of filtering, using convolution and correlation
A description of how to perform filtering using the imfilter function
A discussion about using predefined filter types
See Filter Design for information about how to design filters.
Amen amen amen


Correlation

The operation called correlation is closely related to convolution. In correlation, the value of an output pixel is also computed as a weighted sum of neighboring pixels. The difference is that the matrix of weights, in this case called the correlation kernel, is not rotated during the computation. The filter design functions in the Image Processing Toolbox return correlation kernels.

The following figure shows how to compute the (2,4) output pixel of the correlation of A, assuming h is a correlation kernel instead of a convolution kernel, using these steps: Slide the center element of the correlation kernel so that lies on top of the (2,4) element of A. Multiply each weight in the correlation kernel by the pixel of A underneath. Sum the individual products from step 3.
Fig $$$$$$$$$$$$$$$$$$$$$$$$$$$$$
amen
Wednesday, April 08, 2009
Wednesday, April 15, 2009

Multiplication and Division of Polynomials


To multiply and divide polynomials, use conv and deconv on Galois vectors that represent the polynomials. Multiplication and division of polynomials is equivalent to convolution and deconvolution of vectors. The deconv function returns the quotient of the two polynomials as well as the remainder polynomial. Examples are below.
m = 4;
apoly = gf([4 5 3],m); % A^2 x^2 + (A^2 + 1) x + (A + 1)
bpoly = gf([1 1],m); % x + 1
xpoly = gf([1 0],m); % x
% Product is A^2 x^3 + x^2 + (A^2 + A) x + (A + 1).
cpoly = conv(apoly,bpoly);
[a2,remd] = deconv(cpoly,bpoly); % a2==apoly. remd is zero.
[otherpol,remd2] = deconv(cpoly,xpoly); % remd is nonzero.


The multiplication and division operators in Arithmetic in Galois Fields multiply elements or matrices, not polynomial.
%Multiplication and Division of Polynomials
%15 APRIL 2009
%eureka eureka

%To multiply and divide polynomials, use conv and deconv on Galois vectors that represent
%the polynomials.
%Multiplication and division of polynomials is equivalent to convolution and deconvolution
% of vectors.
% The deconv function returns the quotient of the two polynomials as well as
%the remainder polynomial. Examples are below.
m = 4;
apoly = gf([4 5 3],m); % A^2 x^2 + (A^2 + 1) x + (A + 1)
bpoly = gf([1 1],m); % x + 1
xpoly = gf([1 0],m); % x
% Product is A^2 x^3 + x^2 + (A^2 + A) x + (A + 1).
cpoly = conv(apoly,bpoly);
[a2,remd] = deconv(cpoly,bpoly); % a2==apoly. remd is zero.
[otherpol,remd2] = deconv(cpoly,xpoly); % remd is nonzero.

%outputs

m = 4;
apoly = gf([4 5 3],m); % A^2 x^2 + (A^2 + 1) x + (A + 1)
bpoly = gf([1 1],m); % x + 1
xpoly = gf([1 0],m); % x
% Product is A^2 x^3 + x^2 + (A^2 + A) x + (A + 1).
cpoly = conv(apoly,bpoly);
[a2,remd] = deconv(cpoly,bpoly); % a2==apoly. remd is zero.
[otherpol,remd2] = deconv(cpoly,xpoly); % remd is n
apoly

apoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 5 3
bpoly

bpoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

1 1
cpoly

cpoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 1 6 3
otherpol

otherpol = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 1 6

apoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 5 3
bpoly

bpoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

1 1
otherpol

otherpol = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 1 6
conv(otherpol,bpoly)

ans = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 5 7 6
cpoly

cpoly = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 1 6 3
conv(apoly,bpoly)

ans = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

4 1 6 3

Wednesday, April 15, 2009
%computes the convolution matrix for a vector b in GF(4),
%representing the numerator coefficients for a digital filter.
%15 april 2009
%Example
%The example below computes the convolution matrix for a vector b in GF(4),
%representing the numerator coefficients for a digital filter.
%It then illustrates the two equivalent ways to convolve b with x over the Galois field.

m = 2; b = gf([1 2 3]',m);
n = 3; x = gf(randint(n,1,2^m),m);
C = convmtx(b,n); % Compute convolution matrix.
v1 = conv(b,x); % Use conv to convolve b with x
v2 = C*x; % Use C to convolve b with x.

%outputs

To get started, select MATLAB Help or Demos from the Help menu.

>> m = 2; b = gf([1 2 3]',m);
n = 3; x = gf(randint(n,1,2^m),m);
C = convmtx(b,n); % Compute convolution matrix.
v1 = conv(b,x); % Use conv to convolve b with x
v2 = C*x; % Use C to convolve b with x.
>> b

b = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

1
2
3

>> v1

v1 = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

3
1
0
3
1

>> v2

v2 = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

3
1
0
3
1

>> b

b = GF(2^2) array. Primitive polynomial = D^2+D+1 (7 decimal)

Array elements =

1
2
3

>>
Wednesday, April 15, 2009

Discrete Fourier Transform


The discrete Fourier transform is an important tool in digital signal processing. This toolbox offers these tools to help you process discrete Fourier transforms:

%fft, which transforms a Galois vector

%ifft, which inverts the discrete Fourier transform on a Galois vector

%dftmtx, which returns a Galois array that you can use to perform or invert the discrete Fourier transform on a Galois vector

%In all cases, the vector being transformed must be a Galois vector of length 2m-1 in the field %GF(2m). The examples below illustrate the use of these functions. You can check, using the %isequal function, that y equals y1, z equals z1, and z equals x.
m = 4;
x = gf(randint(2^m-1,1,2^m),m); % A vector to transform
alph = gf(2,m);
dm = dftmtx(alph);
idm = dftmtx(1/alph);
y = dm*x; % Transform x using the result of dftmtx.
y1 = fft(x); % Transform x using fft.
z = idm*y; % Recover x using the result of dftmtx(1/alph).
z1 = ifft(y1); % Recover x using ifft.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %outputs


>> x

x = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal) %signal

Array elements =

7
14
12
7
0
13
7
9
12
14
11
2
6
14
14

>> length(x) %length of signal

ans =

15
>> dm
m = 4;
x = gf(randint(2^m-1,1,2^m),m); % A vector to transform
alph = gf(2,m);
dm = dftmtx(alph);
idm = dftmtx(1/alph);
y = dm*x; % Transform x using the result of dftmtx.
y1 = fft(x); % Transform x using fft.
z = idm*y; % Recover x using the result of dftmtx(1/alph).
z1 = ifft(y1); % Recover x using ifft.

dm = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

Columns 1 through 8

1 1 1 1 1 1 1 1
1 2 4 8 3 6 12 11
1 4 3 12 5 7 15 9
1 8 12 10 15 1 8 12
1 3 5 15 2 6 10 13
1 6 7 1 6 7 1 6
1 12 15 8 10 1 12 15
1 11 9 12 13 6 15 3
1 5 2 10 4 7 8 14
1 10 8 15 12 1 10 8
1 7 6 1 7 6 1 7
1 14 11 8 9 7 12 4
1 15 10 12 8 1 15 10
1 13 14 10 11 6 8 2
1 9 13 15 14 7 10 5

Columns 9 through 15

1 1 1 1 1 1 1
5 10 7 14 15 13 9
2 8 6 11 10 14 13
10 15 1 8 12 10 15
4 12 7 9 8 11 14
7 1 6 7 1 6 7
8 10 1 12 15 8 10
14 8 7 4 10 2 5
3 15 6 13 12 9 11
15 12 1 10 8 15 12
6 1 7 6 1 7 6
13 10 6 2 15 5 3
12 8 1 15 10 12 8
9 15 7 5 12 3 4
11 12 6 3 8 4 2

>> idm = dftmtx(1/alph);
>> idm = dftmtx(1/alph)

idm = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

Columns 1 through 8

1 1 1 1 1 1 1 1
1 9 13 15 14 7 10 5
1 13 14 10 11 6 8 2
1 15 10 12 8 1 15 10
1 14 11 8 9 7 12 4
1 7 6 1 7 6 1 7
1 10 8 15 12 1 10 8
1 5 2 10 4 7 8 14
1 11 9 12 13 6 15 3
1 12 15 8 10 1 12 15
1 6 7 1 6 7 1 6
1 3 5 15 2 6 10 13
1 8 12 10 15 1 8 12
1 4 3 12 5 7 15 9
1 2 4 8 3 6 12 11

Columns 9 through 15

1 1 1 1 1 1 1
11 12 6 3 8 4 2
9 15 7 5 12 3 4
12 8 1 15 10 12 8
13 10 6 2 15 5 3
6 1 7 6 1 7 6
15 12 1 10 8 15 12
3 15 6 13 12 9 11
14 8 7 4 10 2 5
8 10 1 12 15 8 10
7 1 6 7 1 6 7
4 12 7 9 8 11 14
10 15 1 8 12 10 15
2 8 6 11 10 14 13
5 10 7 14 15 13 9
>> y
y = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)
Array elements =

12
11
12
5
2
4
0
4
6
14
7
1
6
1
2

>> y1

y1 = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

12
11
12
5
2
4
0
4
6
14
7
1
6
1
2

>> y-y1 %difference between "F. transforms by 2 different methods.

ans = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

>> z

z = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

7
14
12
7
0
13
7
9
12
14
11
2
6
14
14

>> z1

z1 = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

7
14
12
7
0
13
7
9
12
14
11
2
6
14
14

>> z-z1 %difference between original signals by 2 diff. methods.

ans = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

>> amen amen amen
Wednesday, April 15, 2009

Polynomials over Galois Fields


You can use Galois vectors to represent polynomials in an indeterminate quantity x, with coefficients in a Galois field. Form the representation by listing the coefficients of the polynomial in a vector in order of descending powers of x. For example, the vector
gf([2 1 0 3],4)


represents the polynomial Ax3 + 1x2 + 0x + (A+1), where

A is a primitive element in the field GF(24).

x is the indeterminate quantity in the polynomial.

You can then use such a Galois vector to perform arithmetic with, evaluate, and find roots of polynomials. You can also find minimal polynomials of elements of a Galois field.

Wednesday, April 15, 2009
Communications Toolbox
Addition and Subtraction of Polynomials

To add and subtract polynomials, use + and - on equal-length Galois vectors that represent the polynomials. If one polynomial has lower degree than the other, then you must pad the shorter vector with zeros at the beginning so that the two vectors have the same length.

The example below shows how to add a degree-one and a degree-two polynomial.
lin = gf([4 2],3); % A^2 x + A, which is linear in x
linpadded = gf([0 4 2],3); % The same polynomial, zero-padded
quadr = gf([1 4 2],3); % x^2 + A^2 x + A, which is quadratic in x
% Can't do lin + quadr because they have different vector lengths.
sumpoly = [0, lin] + quadr; % Sum of the two polynomials
sumpoly2 = linpadded + quadr; % The same sum.


%outputs

>> lin

lin = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)

Array elements =

4 2

>> linpadded

linpadded = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)

Array elements =

0 4 2

>> quadr

quadr = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)

Array elements =

1 4 2

>> sumpoly

sumpoly = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)

Array elements =

1 0 0

>> sumpoly2

sumpoly2 = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)

Array elements =

1 0 0
Wednesday, April 15, 2009
Simulink
Polynomial


Perform evaluation of polynomial coefficients on input values
Library


Math Operations
Description
block

The Polynomial block uses a coefficients parameter to evaluate a real polynomial for the input value.

You define a set of polynomial coefficients in the form accepted by the MATLAB polyval command. The block then calculates P(u) at each time step for the input u. Inputs and coefficients must be real.
Data Type Support


The Polynomial block accepts real signals of types double or single. The Polynomial coefficients parameter must be of the same type as the inputs. The output data type is set to the input data type.
polynomial coefficients


Values are in coefficients of a polynomial in MATLAB polyval form, with the first coefficient representing x^N, then decreasing in order until the last coefficient, which represents the constant for the polynomial. See polyval in the MATLAB documentation for more information.

Wednesday, April 15, 2009



%Communications Toolbox
%Evaluating Polynomials
%15 april 2009
%sayanyein

%To evaluate a polynomial at an element of a Galois field, use polyval.
%It behaves like the ordinary MATLAB polyval function when given exactly two input arguments. The example below evaluates a polynomial at several elements in a field and checks the results using .^ and .* in the field.

m = 4;
apoly = gf([4 5 3],m); % A^2 x^2 + (A^2 + 1) x + (A + 1)
x0 = gf([0 1 2],m); % Points at which to evaluate the polynomial
y = polyval(apoly,x0);

a = gf(2,m); % Primitive element of the field, corresponding to A.
y2 = a.^2.*x0.^2 + (a.^2+1).*x0 + (a+1) ;% Check the result.


%The output is below.
%y = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

%Array elements =

% 3 2 10


%y2 = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

%Array elements =

% 3 2 10



%The first element of y evaluates the polynomial at 0 and, therefore,
%returns the polynomial's constant term of 3
%outputs
To get started, select MATLAB Help or Demos from the Help menu.


a = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)

Array elements =

2
y

y = GF(2^4) array. Primitive polynomial = D
%1 nov. 2009

hind parts of lion or a big inverted begging bowl!

hind parts of lion or a big inverted begging bowl!
1 nov. 2009
Soethein-to-rd
Humour Editor,
Reader 's Digest Asia,
Editorial Department,
Singapore Post Centre,PO Box272,Singapore 914010.

hind parts of lion or a big inverted begging bowl!
Dear Editor,
We are on a pilgrimage trip from Mandalay to a small village –Mingum(where the world's largest ringing bell is situated). It stands on the bank of Irrawaddy river .
Beside the big bell , there is an unfinished gigantic pagoda – only the base had been
completed .
In front ,there are two chinthes(Burmese mythical lions)guarding the
entrance of the big pagoda .
Due to an earthquake and unproportioned built,both of them had been crumbled down to the ground. Only the hind parts remain to this day.
They are almost three stories high and were blackened with moss and lichens. A professor of mine mistaken this (hind parts of the mythical lion )with a big inverted begging bowl,seen from a distance.
Sicerely yours,
Soee Theynn,
#65,Tit Tar Win,
B/W 27 & 28-and 83& 84 Street,
Chan Aye Thar Zan T/S,
Kennedy Space Villa,
Zegyo – Mandalay,
Union of Myanmar.
asia.rd@readersdigest.com
soethein1938@gmail.com
khin mg bo ,58 st,,no. 93,
mother home
you are a guru, but u can not tolerate people;irritated very easily.
km bo,
with love.