I have written this code but when I run it it gives error.
center = rms(20,30,20);center2(:,:) = center(:,1,:);for i=1:1:222 for j=1:1:260 B1p(i,j) = 0.5*((x(i,j)+(sqrt(-1)*x(i,j)))+sqrt(-1)*(y(i,j)+(sqrt(-1)*y(i,j)))); B1n(i,j) = 0.5*(conj(((x(i,j)+(sqrt(-1)*x(i,j)))-sqrt(-1)*(y(i,j)+(sqrt(-1)*y(i,j)))))) / sqrt(-1) ; endendfor m=1:1:222 for n=1:1:260 if center2(m,n)==0 mapB1p(m,n)=0; mapB1n(m,n)=0; else mapB1p(m,n)=B1p(m,n); mapB1n(m,n)=B1n(m,n); end endend % clims = [min(min(B1p)) max(max(B1p))];
figure, imagesc(abs(B1p)); colormap jet;
It generates the following error:
Error using rmsToo many input arguments.Error in OpenFiles (line 41)center = rms(20,30,20);
What does this error mean? and how to remove this error?
Any help in the optimization of this code is appreciated.
Also, I have another question:
If I want to find out the rms of x and store it in another variable y. Then, how to write this code.
x=databx;y = rms_x(:,30,:);
Is this code correct?
Best Answer