I am trying to find out how to make my output have spaces in between the indices of the vector…This is what I have so far, which is giving me the correct vector output:
A=input('Enter values in A in vector form:');for i=1:length(A) if (A(i)>0) B(i) = A(i)^3; else B(i) = 0; endendfprintf('The output vector is :\t[')fprintf('%d',B)fprintf(']\n')
Best Answer