MaTLaB DeRS-4 - MF-102 Bilgisayar Programlama Bahar 2008(4....

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MF-102 Bilgisayar Programlama Bahar 2008(4. Hafta)(Yrd. Do. Dr. Deniz Dal)return KomutuYazdnz MATLABprogramn herhangi bir anda (programn normalde sona erdii noktann haricinde - early termination) sona erdirmek iin returnkomutunu kullanabilirsiniz. Bu ilem iin breakkomutunu KULLANMAYINIZ. PROGRAMINIZI AN SONLANDIRMAK STEDNZ YER BR DNGNN SE NE OLUR?????????breakkomutunu sadece forve whiledngleri iinde kullannz.Eer returnkomutu ana program ierisinde kullanlmsa, kontrol komut penceresindeki klavyeye geer. Eer returnkomutu bir fonksiyon ierisinde kullanlmsa, kontrol bu fonksiyonu aran ana fonksiyona devredilir. (Fonksiyonlar daha sonraki derslerimizde greceiz.) Bir nceki dersimizde ise returnkomutunu komut satrndan altrarak hata ayklama modundan kmtk.rnek :ax+bx+c=0eklinde verilen 2. derece denklemin kklerini bulan programn ak diyagramn iziniz.(Bu denklemin ikinci derece olmad uyarsn nasl verirsiniz?)clc;clear;a=input(akatsayisini giriniz= );b=input(bkatsayisini giriniz= );c=input(csabitini giriniz= );delta=b^2-4*a*c;ifdelta<0disp(Kokler Sanal);return; %Programi Ani Sonlandirelsedisp(Kokler Reel);endX1=(-b+sqrt(delta))/(2*a);X2=(-b-sqrt(delta))/(2*a);fprintf(1. Kok : %g \n, X1);fprintf(2. Kok : %g \n, X2);PROBLEMN MATLABDE PROGRAMLANMASIUYGULAMA : 1x5 boyutunda (1 satr ve 5 stun) bir...
View Full Document

This note was uploaded on 04/23/2010 for the course ENGINEERİ CS 111 taught by Professor - during the Spring '10 term at Bilkent University.

Page1 / 16

MaTLaB DeRS-4 - MF-102 Bilgisayar Programlama Bahar 2008(4....

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online