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

10 Ansichten (letzte 30 Tage)
nick
nick am 20 Dez. 2016
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 Kommentare
per isakson
per isakson am 21 Dez. 2016
Bearbeitet: per isakson am 21 Dez. 2016
  • 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
Waldemiro Kubucama am 1 Aug. 2020
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by