how I can use fprintf for syms

12 次查看(过去 30 天)
hashem zohdi
hashem zohdi 2013-1-8
hello I want to print syms with scinstific model. can you help me?
example:
Function a(n)
digits(400)
syms t
t=n;
z=vpa(t/3);
fprintf('%3,3e',z);
end
with extra thanks
zohdi

回答(1 个)

Hassan F
Hassan F 2013-1-8
编辑:Hassan F 2013-1-8
have you tried the following?
fprintf('%3.3e',sscanf(char(z),'%e'))
  2 个评论
Walter Roberson
Walter Roberson 2013-1-8
If you were going to do that, then
fprintf('%3.3e', double(z))
Hassan F
Hassan F 2013-1-8
You're right. Disregard my answer please.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by