求问一个循环编程 我为什么写错了。
显示 更早的评论
有个编程题:
x<1时 y=x
1<=x<10时y=2x-1
10<=x时 y=3x-11
我是这么写的
clc;clear all
if i<1
y=i;
elseif i>=1&i<10
y=2*i-1;
elseif i>=10
y=3*i-11;
end
i=input('给个数=','s');
S=y
请问为什么错了?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!