In my function I’d create a variable that will contain simply one number. How do I initialize it?I have to initialize it to 0 value or I can initialize it simply putting in function var;
In my function I’d create a variable that will contain simply one number. How
Share
In Matlab, variables are initialized dynamically. There is no C++ or Java equivalent of memory allocation versus initialization.
For example:
C code:
Matlab code:
You can’t break this in two parts in the following way:
Also, I am not sure whether you meant that
varis some kind of a keyword, but in case you think it is – you’re mistaken.