matlab results grouped question

조회 수: 1 (최근 30일)
pablolama
pablolama 2019년 2월 4일
댓글: pablolama 2019년 2월 4일
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에서 Elementary Math에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by