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!