哪位高手帮忙看看下面MATLAB进行模拟股票价格的程序是否有问题啊
function [St]=Stock(T,dt,S0,mu,sigma)
% Simulation of a Stock Price with constant Volatility
clc;
T=input('Specify the desired long time period ');
dt=input('Specify time internals ');
S0=input('Specify the initial Stock Price ');
mu=input('Specify the expected rate of return ');
sigma=input('Specify the volatility ');
%Number of time intervals of length dt in long time period T
N=T/dt;
%Simulation of the stock prices
S=1+mu*(1/N)+sqrt(1/N)*normrnd(0,1,N,1)*sigma;
St=cumprod(S,1);
St=S0*[1;St];
%Plot of the stock prices vs time
k=input('Do you want a graph, Y/N? ','s');
if k=='Y'
for i=1:length(St)
figure(1)
clf
x=0:dt:T;
plot(x(1:i),St(1:i),'b-');
xlim([0 T]);
grid on
xlabel('Time')
ylabel('Stock Prices')
title('Stock Price Simulation (\sigma=35%)')
pause(0.003);
end
else
end