indexing into an array
조회 수: 6 (최근 30일)
이전 댓글 표시
I know this is probably one of the easiest thing to do, but right now, I am stuck at it. I have got 2 Arrays. One is 55618x4 (A) and the other one is 1819x1 (B).
A
1 -20.8047047000000 -9 9
2 -20.8047047000000 -9 -9
3 20.8047047000000 -9 -9
4 20.8047047000000 -9 9
5 -20.8047047000000 9 -9
6 20.8047047000000 9 -9
7 20.8047047000000 9 9
8 -20.8047047000000 9 9
9 41.6427193000000 9 -9
B
514
515
516
517
518
519
520
According to the number in the first column, the information from the three other columns should be written from array A to array B. So I need something like this:
C
514 41.64271 8.5 0
515 40.46843 7.3 5
With
[LIA,LOCB]=ismember(s11(:,1),Coords(:,1));
I can find the rows I need, but how can I fill the array?
댓글 수: 2
Steven Lord
2021년 9월 20일
It's not at all clear how you got from A and B to C. Why do you take data from the 1st row of B and the 9th row of A (I assume) to generate the 1st row of C? And where did 8.5 and 0 come from? Neither of those numbers appear in either A or B.
Please explain the rules you want to use to create C more thoroughly and clearly.
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!