求问一个循环编程 我为什么写错了。
Show older comments
有个编程题:
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
请问为什么错了?
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!