MATLAB Answers

how make exe program produced from matlab excute many times

1 view (last 30 days)
mangood UK
mangood UK on 20 Feb 2013
hi: i have this code
the problem in this program is that executed only one then closed
i need to re excited until push close button what function that can do this???
can i use while loop or something!!!!!!1
----------------------------------------------------------------
prompt={'enter number of distance ',
'enter the size of step ',
'ymin:',
'ymax',
'xmin',
'xmax'};
dlgtitle = 'Dr.nazar graph in 2D';
no = 1;
options.Resize='on';
options.Interpreter='tex';
value = {'','3','-20','20','-20','20'};
answer = inputdlg(prompt, dlgtitle, no, value, options);
N =str2double(answer(1,:));
step=str2double(answer(2,:));
ymin=str2double(answer(3,:));
ymax=str2double(answer(4,:));
xmin=str2double(answer(5,:));
xmax=str2double(answer(6,:));
dis =inputdlg( cellstr( num2str((1:N).', 'distance number %d') ),dlgtitle,no );
% answer_str = char(answer);
h=((xmax-xmin)/2)+xmin;
for i=1:N-1
distance(i)=str2double (dis(i,:))/2;
x(i)=h-distance(i);
x(N)=h;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
for i=1:N-1
x(i+N)=h+distance(N-i);
end
start=2;
y(1)=ymin+start;
y(N)=y(1)+str2double (dis(N,:));
for i=2:N-1
y(i)=y(i-1)+step;
end
for i=1:N-1
y(2*N-i)=y(i);
end;
w=2*N-1;
j=[x(N-1) x(N) x(N+1:w)];
b=[y(1) y(N) y(N+1:w)];
patch(j ,b,'y');

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.

Products