필터 지우기
필터 지우기

Importing time-varying variables from Matlab to Simulink

조회 수: 1 (최근 30일)
Alex Smith
Alex Smith 2012년 6월 18일
Hi there,
I'm trying to use several variables in a simulink design which are initially calculated iteratively in a Matlab script, like this...
for k=2:1:N(2) % Solve for Lambda and Gamma
funL =@(w) samplingT*(Km(:,:,k) - (Cm(:,:,k) - Lambda(:,:,k-1)) * Lambda(:,:,k-1)) + Lambda(:,:,k-1) - w;
Lambda(:,:,k) = fsolve(funL, eye(2));
Gamma(:,:,k) = Cm(:,:,k) - Lambda(:,:,k);
end
My problem is how to set up the "to workspace" structure, in terms of time, values and dimensions (Gamma and Lambda are 2x2 matrices for example).
Any help would be appreciated.
Regards, Alex

답변 (1개)

Ryan G
Ryan G 2012년 6월 18일
If you have 2 dimensional data you could use a 2-d lookup table.
If the input is based on time you can utilize a clock or digital clock as one of the inputs to utilize time.
  댓글 수: 1
Alex Smith
Alex Smith 2012년 6월 18일
Doesn't really fit with what I'm doing, but thanks for the reply.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by