matlab results grouped question

1 次查看(过去 30 天)
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 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-2-4
How you got the results, share code?
pablolama
pablolama 2019-2-4
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

请先登录,再进行评论。

采纳的回答

Stephan
Stephan 2019-2-4
编辑:Stephan 2019-2-4
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 个评论
pablolama
pablolama 2019-2-4
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?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by