Matlab基础作业
记录做过的有关Matlab语言的作业
Mozart086
学习爱好者
展开
-
Matlab计算BMI数值与健康指标的函数
Homework problem: Write a Matlab function to calculate the body mass index (BMI) with the following function prototype:function [BMI, status] = ComputeBMI(weight_kg, height_cm)where the input weight_kg is the weight measured in kilograms and height_cm原创 2021-08-10 18:54:50 · 1657 阅读 · 1 评论 -
Matlab凯撒密码加密解密
Pratice problem: Bob wants to send the message “Start sending messages at 8:30” to Alice in a secret way as an encrypted message. Write a program that encrypts and decrypts Bob's message. (Hint: Use the ASCII table) Two parts must be output: the encrypted原创 2021-08-09 23:56:54 · 1921 阅读 · 0 评论 -
Matlab手动实现两位数加减乘除
该函数可以实现运算符类型检索、运算符位置检索、识别这两个两位数的数值以及不用str2num函数进行字符串与数字的转换。例如,输入‘12 + 23’,可以得到35。function ret = myeval(str)%输入计算的字符串,返回运算符类型与运算符位置ASCII_list= abs(str);len_str = length(ASCII_list);flag = 0;position = 0;for i = 1:len_str if ASCII_list(i) ...原创 2021-08-09 17:49:49 · 1842 阅读 · 2 评论