Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to fprintf vectors of symbolic function with parentheses

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Walter Roberson
Walter Roberson il 29 Ott 2017
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

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by