フィルターのクリア

How can I pass a character function to the input of another function?

1 回表示 (過去 30 日間)
Grek Vardugin
Grek Vardugin 2018 年 11 月 20 日
Hello! I had the following problem. I need to make it so that I can enter a symbolic function, which will later be used:
F = s.*exp(s.*t);
and I need to use this function as an input to another example:
function Example(Aval, Bval, Cval ,Dval, Nval, Mval, F)
hs = (Bval - Aval)/(Nval - 1);
ht = (Dval - Cval)/(Mval - 1);
Sval = (Aval:hs:Bval)';
Tval = (Cval:ht:Dval)';
Amat = zeros(Mval,Nval);
hs = (Tval(Nval) - Tval(1))/(Nval - 1);
for i=1:Mval,
Amat(i,1) = F(Sval(i),Tval(1))/2;
for j=2:(Nval-1),
Amat(i,j) = F(Sval(i),Tval(j));
end
Amat(i,Nval) = F(Sval(i),Tval(Nval))/2;
end
Amat = hs*Amat;
end;
The problem is that I need to do this for codegen. How can I do it?
myhelp = {ones(1,1,'double'),ones(1,1,'double'),ones(1,1,'double'),ones(1,1,'double'),ones(1,1,'double'),ones(1,1,'double'), ???????????};
codegen Example.m -args myHelp

回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Handles についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by