MATLAB: How can i display a vector as a result of a for loop for loop I have thi loop for and i want to display the mmk but i can't for rload=0:20:50000 v = -x(:,3)*rload; mn =(max(v)-min(v))/2 mk=mn'; end Best Answer Index the variables and leave off the semicolonfor rload=0:20:50000 v = -x(:,3)*rload; mn =(max(v)-min(v))/2 % A single number. mk(rload) = mnend Related SolutionsMATLAB: How can i display a vector as a result of a for loop ii=0:200:50000;n = numel(ii);mn = zeros(n,1);for jj = 1:n v = -ii(jj).*x(:,3); mn(jj) = (max(v)-min(v))./2 ;endor without for..end loopv = x(:,3)*(0:200:50000);mn = (max(v) - min(v))/2; MATLAB: How can i plot the magnitude of displacement Your code hasfor rload=0:20:50000but you do not use the value of rload anywhere in your code.Note: that loop could be replaced by justfk = abs(x(:,1)); Related QuestionQuestion about min and maxEuler’s method, error, when I run the code i get an error message when trying to create the array for the x values, Array indices must be positive integers or logical values.
Best Answer