MATLAB: Is it possible with for loop s1,s2,s3 variable looping for loopvariable Hy I wonder it is possible something this (looping with variable name) : s1 = 5;s2 = 6;s3 = 7;for i = 1:3 s[(i)] or s(i)end Best Answer First see:How can I create variables A1, A2,...,A10 in a loop? Please don't do this!Alternatives to the eval Functionthen trys = zeros( 1,3);for ii = 1 : 3 s(ii) = rand; end Related SolutionsMATLAB: Input variable value to matrix syms s1 s2 s3subs(left_ARE,{s1, s2, s3}, {1, 5, 10}) MATLAB: Im trying to make array of images s1,s2,s3 and s4 and want to show them in different figures ……….. what is wrong over there? ……… cleararr={s1,s2,s3,s4}; for i=1:4 b=imread(arr{i}); figureimshow(b); end Related QuestionError struct with fieldLoopI want to find the determinant for 5.5 matrixLoopsMatlab solve indeterminate polynomial equations numericallySolving system of equations with parametersLoops
Best Answer