Zahlenformat Matlab - Schnell gefragt

Sherman123

Fleet Admiral
Registriert
Nov. 2002
Beiträge
12.343
Mein Code sieht so aus
Code:
function SiiL

format short
S0=[47138 3923 0
    3923 13526 0
    0 0 4400];


x=0;
while x<91;
   
x
T=[cos(x)^2 sin(x)^2 -2*sin(x)*cos(x)
    sin(x)^2 cos(x)^2 2*sin(x)*cos(x)
    sin(x)*cos(x) -sin(x)*cos(x) sin(x)^2-cos(x)^2];
TT=transpose(T);
 S=T*S0*TT
  x=x+5;
end

Das ist meine Ausgabe:
Code:
X=
     0


S =

       47138        3923           0
        3923       13526           0
           0           0        4400


x =

     5


S =

  1.0e+004 *

    1.3625    0.6529    0.3465
    0.6529    4.1828   -1.2607
    0.3465   -1.2607    0.7006


x =

    10


S =

  1.0e+004 *

    2.9852    1.1261    1.4230
    1.1261    1.6135    0.1113
    1.4230    0.1113    1.1738

Ich will, dass die Ausgabe so aussieht wie bei 0°. Mit dem *1.0e+004 Term kann ich nicht so viel anfangen, wenn ich die Werte manuell in ein anderes Programm einfüge.
Was kann ich tun?


EDIT: Weiß niemand, wie ich die Verwendung von Zehnerpotenzen verbiete??

EDIT2: Lösung schon gefunden:
shortG


Fixed- or floating-point, whichever is more readable, with 4 digits after the decimal point. For example, 3.1416.

See Example 5, for a comparison between this format and short.

longG


Fixed- or floating-point, whichever is more readable, with 14 to 15 digits after the decimal point for double; and 6 or 7 digits after the decimal point for single. For example, 3.14159265358979.
 
Zuletzt bearbeitet:
Zurück
Oben