フィルターのクリア

stop the function from displaying

1 回表示 (過去 30 日間)
pemfir
pemfir 2012 年 9 月 28 日
I apologize for posting a similar question. I had a wrong example in my previous post. this one should show the problem. I have the following function (please do not suggest that i change the function itself):
function [sumf] = delet();
for i = 1:2;
syms d u ;
f = (char(vpa(subs((d/u - strcat('k',num2str(i))),{d,u},{1,2}))));
a = symvar(char(vpa(f)));
f = ['@(', sprintf('%k1,', a{1:end-1}), a{end}, ') ',f];
f = eval(f);
x = strcat('f',num2str(i));
eval(sprintf('%s = f',x));
end
sumf = @(k) f1(k(1))+f2(k(2));
once called : f = delet;
f1 =
@(k1)0.5-1.0*k1
f2 =
@(k2)0.5-1.0*k2
on the display. how do i stop this ?

採用された回答

Daniel Shub
Daniel Shub 2012 年 9 月 28 日
You are missing a semicolon inside the eval
eval(sprintf('%s = f;',x));
  1 件のコメント
pemfir
pemfir 2012 年 9 月 28 日
thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by