Konversi Suhu Menggunakan MatLab

clc
clear


disp('KONVERSI SUHU')
disp('')
disp('Keterangan :')
disp('1. C = Celcius')
disp('2. R = Reamur')
disp('3. F = Fahrenheit')
disp(' ')
suhu=input('Masukkan Nilai Suhu : ');
sat=input ('Masukkan Satuan Suhu : ');
disp(' ')
disp('Hasil Konversi :')

if sat==1
C=suhu;
R=(4/5)*C;
F=(9/5)*C+32;
disp(['R = ' num2str(R) ' Reamur'])
disp(['F = ' num2str(F) ' Fahrenheit'])
else if sat==2
R=suhu;
C=(5/4)*R;
F=(9/4)*C+32;
disp(['C = ' num2str(R) ' Celcius'])
disp(['F = ' num2str(F) ' Fahrenheit'])
else if sat==3
F=suhu;
C=(5/9)*(F-32);
R=(4/9)*(F-32);
disp(['C = ' num2str(R) ' Celcius'])
disp(['R = ' num2str(F) ' Reamur'])
end
end
end

Capture4
Capture5
Advertisement

4 thoughts on “Konversi Suhu Menggunakan MatLab

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.