Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how to fprintf vectors of symbolic function with parentheses

1 Ansicht (letzte 30 Tage)
Muhendisleksi
Muhendisleksi am 29 Okt. 2017
Geschlossen: Walter Roberson am 29 Okt. 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 Kommentar
Walter Roberson
Walter Roberson am 29 Okt. 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

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by