indexing into an array
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Patrick Benz
el 20 de Sept. de 2021
Comentada: Patrick Benz
el 20 de Sept. de 2021
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 comentarios
Steven Lord
el 20 de Sept. de 2021
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.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!