matlab input输入字符串 switch case选择判断 小例子
2011-04-27 22:26:32| 分类:
Matlab
| 标签:
|举报
|字号大中小 订阅
clear all;
clc;
s=input('Please input a string b:','s');
switch (s)
case 'Sunday'
s=1;
case 'Monday'
s=2;
case 'Tuesday'
s=3;
case 'Wednesday'
s=4;
case 'Thursday'
s=5;
case 'Friday'
s=6;
case 'Saturday'
s=7;
otherwise
disp('This is error!');
end
disp(s)
评论这张
转发至微博
转发至微博
评论