Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

how to fprintf vectors of symbolic function with parentheses

1 visualización (últimos 30 días)
Muhendisleksi
Muhendisleksi el 29 de Oct. de 2017
Cerrada: Walter Roberson el 29 de Oct. de 2017
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 comentario
Walter Roberson
Walter Roberson el 29 de Oct. de 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

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by