对于C ++案例:
#include <iostream>
using namespace std;
int main()
{
int a = 1;
cout << a << endl;
{ /* Start of a block limiting a scope */
int a = 2;
int b = 3;
cout << a << endl;
} /* End of a block */
cout << a << endl;
// cout << b << endl; /* This stops compilaiton */
return 0;
}
显示结果:
1
2
1
我的问题是, MATLAB是否有与此类似的功能或关键字?