MATLAB可以定义一个'块'限制像C ++这样的范围可以吗?

时间:2016-09-21 02:59:12

标签: matlab

对于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是否有与此类似的功能或关键字?

0 个答案:

没有答案