求问一个循环编程 我为什么写错了。
Afficher commentaires plus anciens
有个编程题:
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
请问为什么错了?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!