Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to fprintf vectors of symbolic function with parentheses

1 回表示 (過去 30 日間)
Muhendisleksi
Muhendisleksi 2017 年 10 月 29 日
閉鎖済み: Walter Roberson 2017 年 10 月 29 日
for example: turev_s('x^2+y^2*sin(t)','t','x,y,t',[1 2 30])
I get an alert when I make the above example. How can I solve this problem?
Can not I show the value of "s" as fprintf?
function turev_s(x, y, d, r)
f = sym(x);
n = length(symvar(f));
if n == 1
s = diff(f,y);
sade = simplify(s)
pretty(s)
if r ~= 0
sonuc = double(subs(f,{d},{r}));
end
elseif n == 2
s = diff(f,y);
sade = simplify(s)
pretty(s)
if r ~= 0
sonuc = double(subs(f,{d},{r}));
end
elseif n == 3
s = diff(f,y);
sade = simplify(s)
pretty(s)
if r ~= 0
sonuc = double(subs(f,{d},{r}));
end
end
fprintf('Sonuc = %.4f\n',sonuc);
end
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 10 月 29 日
Duplicated by later https://www.mathworks.com/matlabcentral/answers/363947-warning-support-of-strings-that-are-not-valid-variable-names-or-define-a-number-will-be-removed-in

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by