in matrix, convert fraction part into decimal
52 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Naseeb Gill
am 16 Dez. 2016
Kommentiert: Naseeb Gill
am 16 Dez. 2016
Hello, I have a matrix in which each element is comes out as fraction part but I want it as decimal part. I'm using symbolic expression in my code with matlabFunction. Code is given below.
syms a b c d e f;
x = [a+b b+c;d+e e+f];
y = matlabFunction(x)
a = 0.222;
b = 3.57;
c = 1.5;
d = 0.351;
e = -.22;
f = f;
y(a,b,c,d,e,f);
The output of this function is like below:
>> y(a,b,c,d,e,f)
ans =
[ 474/125, 507/100]
[ 131/1000, f - 11/50]
I tried to use double and vpa but I'm not getting any results. Can somebody tell me how to solve this problem.
Thanks.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!