Effacer les filtres
Effacer les filtres

Operation between Cells-cons​tant-vecto​r-matrix (4D-problem), cell indexing/storing.

1 vue (au cours des 30 derniers jours)
fredo ferdian
fredo ferdian le 16 Déc 2016
Hello, I try to do some calculation about 4-D problem, calculating parameter which the value will be different for every coordinate x,y,z. I got stuck in the operation between cell array because different type of variable involved. The operation actually quite simple, but the main problem is about calling the specific element of the vector in specific cell. Here’s some description of the problem:
n as cell index = 1000ea (I have 1000 cells)
G(n)=constants(n)*Vector 3x1 (n)* Matrix 5x5 (n)
I want G as a matrix 5x5(n ea) times 3 So, I will have 1000 G as a Matrix 5x5 in each cell but I have 3 of them. In the end I will have 3000 G. I was thinking that the solution might be creating some loop, but I don’t think I can store them.
First I start with something like this more or less.
if true
for index2=1:3
for index = 1 : 1000
SecondTerm{index};
G{index}=FirstTerm{index}*ans(index2)*ThirdTerm{index};
end
end
end
FirstTerm is constant, SecondTerm is Vector and ThirdTerm is Matrix. The second term represent the z coordinate, whereas for the ThirdTerm represent the x and y coordinate.
This loop only created 1000 G Matrix 5x5. I might need to do something with G-indexing but still can’t find any idea yet. Anybody would like give some suggestion?
Thanks in advance.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by