MATLAB: How to declare vector of size 64 vector I am trying to declare a vector of size 64 like zeros(64) but it gives all zero values,so i want to know how to declare vector of size 64 Best Answer There is no declaration of vectors in Matlab, you can pre-allocate memory by creating your array with zeros or whatever you want. Related SolutionsMATLAB: Declaring types in MATLAB "When preallocating, is it possible to declare types? "When preallocating you can select any suitable data type, e.g.:A = zeros(2,3, 'uint8')Read the zeros, ones, nan documentation to know more."Is it worthy in terms of efficiency?"In most cases preallocation is more efficient than not preallocating. MATLAB: How to declare Do you have the symbolic toolbox? If yes thansyms R Gr = 4/pi * atan((R-G)/(R+G));else you're more than likely going to hve to define R and G in terms of domains. For exampleR = 0:0.01:1;G = 0:0.1:10; %Make sure the matrix dimensions agree. r = 4/pi * atan((R-G)/(R+G));Matrix manipulation is what matlab was designed to do at its basic level. the symbolic stuff is an add on that works pretty well. Related QuestionDeclare array in Simulink
Best Answer