[讨论] 如何使用fprintf输出struct之值

楼主: g0251604   2016-10-02 22:27:22
大家好 题目是要解联立方程式,规定要用solve
以下为code
clc;clear;
tic
syms x y z
eq1=7*x+2*y+6*z-660;
eq2=3*x-5*y+5*z-160;
eq3=4*x-2*y+7*z-470;
s=solve(eq1,eq2,eq3);
t1=toc;
fprintf('using ''solve'':\n')
fprintf('x1=')
disp(s.x)
fprintf('x1=%g\n',s.x) <
作者: celestialgod (天)   2016-10-03 02:05:00
用vpa或是double转型就好
楼主: g0251604   2016-10-03 22:03:00
谢谢

Links booklink

Contact Us: admin [ a t ] ucptt.com