%
脚本文件: 温度转换
%
文件名:temp_conversion
%
目标:将输入的华氏温度转换为绝对温度
%
%
版本记录:
%
时间 编者 描述
%
2015-
10-
1 16:
26:
31 泡泡 原始代码
%
%
定义变量:
% temp_f --
华氏温度
% temp_k --
绝对温度
%
清除空间变量
clear;
%
提示用户输入华氏温度
temp_f=input(
'请你输入华氏温度:');
%
转换计算
temp_k=(
5/
9)*(temp_f-
32) +
273.15;
%
输出
fprintf('%6.2f degrees Fahrenheit =%6.2f kelvins.\n', ... %
长语句用三个省略号连接
temp_f,temp_k);
转载于:https://www.cnblogs.com/shuqingstudy/p/4851205.html
相关资源:matlab编程实例100篇
转载请注明原文地址: https://win8.8miu.com/read-1492309.html