Hi all,
I'm trying to round an array of double values to 2 decimals.
This is my code:
for k=1:n, y(k)=k*st; y(k)= sprintf('%0.2f', y(k)); x(k) = sqrt(d^2+(2*y(k))^2)-d; x(k)= sprintf('%0.2f', x(k));end
I got the following error message:
In an assignment A(I) = B, the number of elements in B and I must be the same.
BTW! the value n is 10.
I want the arrays y and x with 2 decimal values. Ex: 1.23
Thanks a lot.
Raúl. In an assignment A(I) = B, the number of elements in B and I must be the same.
Best Answer