matlab results grouped question

1 visualización (últimos 30 días)
pablolama
pablolama el 4 de Feb. de 2019
Comentada: pablolama el 4 de Feb. de 2019
How can i have in results all the first results and all the second results regrouped?
0.3151
-0.3904
0.3412
-0.3416
0.3581
-0.2836
  2 comentarios
KALYAN ACHARJYA
KALYAN ACHARJYA el 4 de Feb. de 2019
How you got the results, share code?
pablolama
pablolama el 4 de Feb. de 2019
I've solved...
I've a problem...
after this code, i obtain 14 2x2 matrix, how can i calculate the inverse of every matrix?
OA=1.42
AB=4.3
BO=3.33
OO=6
alfa=[19.7000, 10.2615, 0.8231, -8.6154, -18.0538, -27.4923, -36.9308, -46.3692, -55.8077, -65.2462, -74.6846, -84.1231, -93.5615, -103.0000];
beta= [37.3648, 40.5764, 43.6511, 46.4267, 48.7411, 50.4573, 51.4816, 51.7706, 51.3269, 50.1884, 48.4165, 46.0853, 43.2749, 40.0669];
gamma= [-68.0355, -66.333, -63.8261, -60.6513, -56.9882, -53.0279, -48.9467, -44.8871, -40.9515, -37.2048, -33.6824, -30.3996, -27.3598, -24.5623]
for i = 1:14
J = [AB*sind(beta(i)) BO*sind(gamma(i)); AB*cosd(beta(i)) BO*cosd(gamma(i))]
end

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 4 de Feb. de 2019
Editada: Stephan el 4 de Feb. de 2019
Hi,
i assume you have the results in a form of:
res1 = [0.3151; -0.3904]
res2 = [0.3412; -0.3416]
res3 = [0.3581; -0.2836]
which looks like in your question:
res1 =
0.315100000000000
-0.390400000000000
res2 =
0.341200000000000
-0.341600000000000
res3 =
0.358100000000000
-0.283600000000000
Then you can do:
res = reshape([res1; res2; res3],2,[]);
group1 = res(1,:)'
group2 = res(2,:)'
which results in:
group1 =
0.315100000000000
0.341200000000000
0.358100000000000
group2 =
-0.390400000000000
-0.341600000000000
-0.283600000000000
Check the reshape function - it is very useful.
Best regards
Stephan
  1 comentario
pablolama
pablolama el 4 de Feb. de 2019
No, unfortunately i've this;
0.2187
-0.3606
0.2738
-0.3349
0.3203
-0.3092
0.3581
-0.2836
they are not "named " (res1, res2)
How can i do to group together the first rows, and together the second rows?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by