필터 지우기
필터 지우기

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

조회 수: 6 (최근 30일)
nick
nick 2016년 12월 20일
댓글: Waldemiro Kubucama 2020년 8월 1일
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
Waldemiro Kubucama 2020년 8월 1일
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