MATLAB里面写的switch语句哪里有错误?我照着复制下来还是报题目的错误
a = 100;
b = 200;
switch(a)
case 100
fprintf('This is part of outer switch %d', a );
switch(b)
case 200
fprintf('This is part of inner switch %d', a );
end
end
fprintf('Exact value of a is : %d', a );
fprintf('Exact value of b is : %d', b );
错误如图
我明明提问了,不知道问题怎么没了…已解决,我文件名命名为switch了,可能当成关键字了(说得不对欢迎大家指正)