how to fix "Enter input arguments by typing them now?"

6 次查看(过去 30 天)
I want to use this public code,but when I run the code I have this message:
Error in gs_plane (line 46)
[n,m,~] = size(Inten);.
I defined Inten. How can I fix it?
% Inputs:
% - Inten: Stack of intensity images
% - I0_idx: center image plane index in stack
% - zvec: vector indicating z values for images in stack
% - num_imgs: number of images to use on either side of the center plane
% - ps: pixel size
% - lambda: wavelength
% - N: number of loops to perform
%
% Outputs:
% - phi: phase matrix corresponding to intensity at center plane
% recovered by the algorithm
%
% Notes:
% - INPUT IMAGES [I0, I1, I2] MUST OF EQUAL SIZE.
% - The units for ps, lambda, and dz MUST BE CONSISTENT.
% - dz is the distance between I0 and I1, should be the negative of the
% distance from I0 and I2
%
% Laura Waller, Gautam Gunjala, July 2014
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ phi ] = gs_multiple_plane( Inten, I0_idx, zvec, num_imgs, ps, lambda, N )
%
[n,m,~] = size(Inten);
E0_est = sqrt(Inten(:,:,I0_idx)).*exp(1i*zeros(n,m));
%
for iternum = 1:N
%
% Propagate forward and replace with measured intensity
prop = propagate(E0_est, lambda, zvec(I0_idx+1:I0_idx+num_imgs), ps);
prop = sqrt(Inten(:,:,I0_idx+1:I0_idx+num_imgs)).*exp(1i*angle(prop));
%
% Propagate all planes back to center
for i = 1: num_imgs
prop(:,:,i) = angle(propagate(prop(:,:,i),lambda, ...
-1*zvec(I0_idx+i),ps));
end
%
% Replace with center plane intensity
E0_est = sqrt(Inten(:,:,I0_idx)).*exp(1i*mean(prop,3));
%
% Flip stack for negative propagation
stk_temp = flipdim(Inten(:,:,I0_idx-num_imgs:I0_idx-1),3);
z_temp = flip(zvec(I0_idx-num_imgs:I0_idx-1));
%
% Propagate backward and replace with measured intensity
prop = propagate(E0_est, lambda, z_temp, ps);
prop = sqrt(stk_temp).*exp(1i*angle(prop));
%
% Propagate all planes back to center
for i = 1: num_imgs
prop(:,:,i) = angle(propagate(prop(:,:,i),lambda, ...
-1*z_temp(i),ps));
end
%
% Replace with center plane intensity
E0_est = sqrt(Inten(:,:,I0_idx)).*exp(1i*mean(prop,3));
end
%
phi = angle(E0_est);
  2 个评论
per isakson
per isakson 2016-12-21
编辑:per isakson 2016-12-21
  • gs_plane &nbsp and &nbsp gs_multiple_plane &nbsp are they the same function?
  • What release of Matlab?
  • "I defined Inten." &nbsp What value did you assign to &nbsp Inten ?
  • "how to fix "Enter input arguments by typing them now?"" &nbsp How does that question relate to &nbsp Error in gs_plane (line 46) ?
Waldemiro Kubucama
Hello, first press button "Run" in Matlab and after only you press the button "ENTER" i your computer. I think your problem will be solved.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

尚未输入任何标签。

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by