How can I print the output data in different way?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
JMS
am 30 Apr. 2014
Kommentiert: Star Strider
am 1 Mai 2014
Hi,
I have a simple equation as below
"
[x,y] = meshgrid(-5: 4: 5, -5: 4: 5);
x1 = -1;
y1 = 0;
V_x1 = ((y-y1)./((x-x1).^2+(y-y1).^2)) "
It does give the output as below
"
V_x1 =
-0.1220 -0.2000 -0.1220
-0.0588 -1.0000 -0.0588
0.1200 0.3333 0.1200
"
Does anyone know how can I have them like
"
V_x1 =
-0.1220 -0.2000 -0.1220 -0.0588 -1.0000 -0.0588 0.1200 0.3333 0.1200
"
To be in one row or column.
Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 30 Apr. 2014
Another way:
V_x1 = V_x1(:)
2 Kommentare
Star Strider
am 1 Mai 2014
My pleasure!
See the documentation for the save function, specifically under Examples, ‘Save Data to ASCII File’.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!