MATLAB: How to specify an exact value of variable in (For Loop) for loop Hi all, I am doing a for loop, but I am wondering how can I extract/specify a value of x when i =2 or 3?, the x now has 3 different values, how can I extract a specific value. for i=1:3 x=i+2 end Thanks, Best Answer for i=1:3 x(i)=i+2;endx(2:3) Related SolutionsMATLAB: Index 1 Variable by another Use ‘logical indexing’:B(isnan(A)) = NaNproduces:B = 20 2 NaN 4 MATLAB: Code Explaination (For Loop) The code is doing linear interpolation between column 4 and column 5, using abs(x) as the portion of the way between the columns. Related QuestionHow to avoid inf value while feature extracting in MatlabQuick vectorization question (for loop)Centroid calculation image stack (for loop)
Best Answer