Saturday, September 28, 2013

How to Generate Animation Video using Matlab?

Let's say you have a mathematical function changing in time (or in any other quantity) and you would like to watch it progress and create an animation out of it. That is very simple to integrate into an existing Matlab code. Basically, by using the mov and getframe(), addframe() commands, one can easily generate the animation file. Below is a sample code snippet for further reference:


mov = avifile('test.avi','fps',7,'quality',100,'keyframe',1);
     
     
    figure('Renderer','zbuffer')
    Z = peaks;
    surf(Z);
    axis tight
    set(gca,'NextPlot','replaceChildren');
    % Preallocate the struct array for the struct returned by getframe
    F(20) = struct('cdata',[],'colormap',[]);
    % Record the movie
    for j = 1:200
        surf(.01+sin(2*pi*j/20)*Z,Z)
        F(j) = getframe;
     
        F = getframe(gcf);
        mov = addframe(mov,F);
     
        pause(0.1);
    end
     
    mov = close(mov); 





Note: I used the following website to obtain the highlighted Matlab code in html: http://tohtml.com/matlab/

Monday, September 02, 2013

Hacı Münib Engin Noyan'ın Hatıratından bir Anı


Hacı Münib Engin Noyan'ın hayatını anlattığı Fatma Güzey'in sunduğu televizyon programında bahsettiği çarpıcı bir anısı var ki, yazıya dökülmesi belki daha çok kişinin duymasına, öğrenmesine vesile olacağı için burada transkriptini çıkarmaya çalıştım. Yorumsuzca aktarıyorum:



...
[Noyan] Bir aile dostumuz - Allah taksiratını affetsin - Prof. Dr. Max Neineke (?) ben daha 16 yaşlarında iken falan bana bir sual sormuştu. Demişti ki "Berlin'de ne oynuyor tiyatroda?".... Biliyorum... "Londra'da ne oynuyor?"... Biliyorum. Çünkü gazetelerden [biliyorum]. "Peki" dedi, "Atina da ne oynuyor?" dedi [Bilmiyorum anlamına gelen yüz ifadesi]

[Güzey] Yunanistanla çok bir şeyiniz yok... bağlantınız...

[Noyan] "Şam'da ne oynuyor? [yine cevap yok]. Bağdad'da ne oynuyor? E sen kendi coğrafyanı tanımıyorsun. Onları [batıyı] tanıyorsun. Biri burnunun dibi. Şam'da tiyatro var mı yok mu onu bile bilmiyorsun. Böyle bir şey olur mu?" dedi bana.

[Güzey] E yönümüz tamamen Avrupa'ya döndürülmüş, altta ne var yanda ne var bilmiyoruz

[Noyan] Ve şu muazzam cümleyi kullandı. Dedi ki "Siz, Türkler" dedi, "Çok aptalsınız".... Sinirlendim tabi. Niye aptal diyorsun ki bana yani? Niye? dedim. "Çünkü" dedi. "Siz doğudan gelen trenin lokomotifi olmak yerine, batıya giden trenin son vagonu olmayı tercih ettiniz." dedi.

[Güzey] Çok güzel bir cümle..

[Noyan] Muazzam bir cümle.. ...
Doğudan gelen medeniyet treninin lokomotifi olmak varken, ki bizim hala da konumumuz o,  elhamdulillah - batıya giden trenin son vagonu olduk. En arkada hayvanları koydukları, uyduruk... Sallana sallana gidip serseme dönmüş

[Güzey] Her an kopma tehlikesi ile de karşı karşıya olan

[Noyan] Evet, birinci sınıf vagon bile olamadık. En son vagon...


.......



Programın tamamının linki (yukarıdaki kısım için 27:00'dan itibaren dinleyebilirsiniz):
http://youtu.be/H8CiJ9XD0sQ

Engin Noyan'ın resmi web sitesi:
http://enginnoyan.com.tr/

Sunday, August 25, 2013

Mohammad Hosayn Farahani's Hajj Travel Route (1885-86)


View Mohammad Hosayn Farahani's Hajj Travel Route (1885-86) in a larger map

Adopted from "The Safarnameh of Mirza Mohammad Hosayn Farahani", from his pilgrimage in 1885-1886.

Farahani's journey to Mecca not only fulfills his pilgrimage obligation but also provides a detailed guidebook for his contemporary Persians needed for their Hajj travels. Thanks to the introduction of railroads between Baku and Batumi, Farahani takes the unconventional route to Mecca, traveling first to Batumi via train and then going to Istanbul by boat stopping along the route in several cities such as Trabzon and Sinop. After Istanbul, he continues his journey by boat to reach Alexandria over the Aegean Sea and from thereon to Jidda via Suez Canal. His return trip was also from the same route and his book was considered to be Guide Michelin of his time for round-trip Persian Hajj.

Sunday, August 11, 2013

Bridge Pedal - 6 Bridge loop

Bridge Pedal - 6 Bridge Loop



Over the weekend, I had the chance to attend the annual Bridge Pedal Event in downtown Portland. There are several routes of various lengths and I chose the 13 miles crossing the 6 bridges. The event is very well organized and good for families. Definitely recommended! Below are some snapshots from my route.



The union station:

Broadway Bridge:

Finish line:

King's Mountain - Sea of Clouds

King's Mountain - Sea of Clouds



King's Mountain is one of the most popular hiking destination for Oregonians especially those living in the "weird" Portland and vicinity. Among many of our hikes to King's Mountain, this one was particularly spectacular when we got closer to the peak. The thick clouds left below formed a virtual blanket over the Tillamook Forest. It almost felt like a sea of clouds. Here are some photos from the day:





King's Mountain on another day

Wednesday, June 26, 2013

Map of Nasir Khusraw's Travels (1046-1052)


View Nasir Khusraw's Travels (1046-1052) in a larger map


Adapted from the Naser-e Khosraw's Book of Travels, W. M. Thackston, Jr. New York, 1986

Nasir Khusraw's Safarname (Book of Travels) has been a classical text for Persian travel writing for the last 1000 years. Confessing that his travels are due to mid life crisis, he set out for Mecca at the age 42 after seeing a dream while in a drunk situation. In his dream, he was pointed the qibla direction (Mecca) when he asks about where the wisdom lays. Following this, he resolves to go for Hajj and rather immediately sets our for Mecca. For the next seven years, he travels through Persia, West Azerbaijan, Turkey, Syria, Cairo, Hijaz, Hafsa and Basra region. 

Monday, May 20, 2013

Mt. Defiance Hike


GPS log overlayed on Google Earth:

 

Columbia Gorge from the Starvation Ridge
 

Warren Lake
  

Trail



The Peak 4900 ft (note the landmark)

Sunday, May 05, 2013

Munra Point Hike, Oregon

Munra Point hike







Beacon Rock from the Munra Point trail

Panoramic Columbia River 

Tuesday, April 30, 2013

Larch Mountain Backpacking - Oregon, United States

Larch Mountain Backpacking




We started on Friday around 7 pm and keep walking until the sun set around 8.10. Found a nice camping spot next to the river and setup the tents. Thanks to the tall trees and no moon, the camp site was pitch black making it a different experience. Had our dinner and went to sleep around 10.30 pm. Woke up at 4.30, had breakfast and started walking up. The weather and the trail were nice. There was snow after 3500 ft but it was okay. We reached the Sherard's point at Larch Mountain at 8.30 am. The view was worth the climb. Except Mt. Rainier, all major mountains were visible (Mt. Hood, Mt. Jefferson, Mt. St. Helens and Mt. St Adams)

Mt. Hood from the Larch Mountain Summit

Our camping ground:

Wednesday, April 24, 2013

Diffraction from Double Slits (Young's Double Slits)



The double slit diffraction is illustrated via the use of finite-difference time-domain (FDTD) simulation. Two sets of double slits with different widths and a single slit - for comparison - are illuminated by normally incident plane waves. When the impinging plane waves reach the slits, they are diffracted into a series of circular waves. In the case of double slits, constructive and destructive interferences create dark (null) and bright spots. Diffraction is basically the phenomenon involving the bending of waves around obstacles and the spreading out of the waves past small openings. Huygen's Principle states that every point on a wavefront acts as a source of tiny wavelets moving forward with the same speed as the wave and the wavefront is the surface tangent to these wavelets. 

Keywords:
Beugung, Difracción, Diffrazione, Kırınım, 回折, Дифракция, Diffractie, Difração, 衍射, Dyfrakcja, Diffraktion, Interferenz, Interferencia, Young's slit,