필터 지우기
필터 지우기

Matlab function help in simulink model

조회 수: 1 (최근 30일)
Pramit Biswas
Pramit Biswas 2013년 8월 19일
i want to write this function in Matlab Function Box
{
function y = func_name(a)
b=b+a;
y=b;
}
the error is b is not defined
Actually I want write code for integration and derivative block

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 19일
편집: Azzi Abdelmalek 2013년 8월 19일
function y = func_name(a)
persistent b
if isempty(b)
b=0;
end
b=b+a;
y=b;
Look at persistent
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 19일
Why do you want to code those blocks?
Pramit Biswas
Pramit Biswas 2013년 8월 20일
1. Learn: How matlab works, what actually happen on this block? logic/math to program in real time; I know that integration can be written as summation. but that theory not works on real time/simulation mode
2. I want to take "to the power" of the signal:Derivative^variable1

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by