求问一个循环编程 我为什么写错了。
古いコメントを表示
有个编程题:
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!