How to add values into rows of cell array?
36 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Currently I have a cell array that has around about 6 entries that are each a matrices
What I want to do is add values into rows 2,3,4 for each column, how would I go about doing this?
Any help is appreciated :)
6 commentaires
Réponses (1)
David Hill
le 19 Mai 2022
Modifié(e) : David Hill
le 19 Mai 2022
Assuming the values to be added are in a matrix (3x6)
for k=1:6
yourCell{k}=randi(256,3,18)-1;%populate yourCell
end
valueAdded=randi(100,3,6);%populate x,y,z values to add
newCell=cell(4,6);
newCell(1:4:end)=yourCell;
for k=1:6
for m=2:4
newCell{4*(k-1)+m}=valueAdded(m-1,k);
end
end
0 commentaires
Voir également
Catégories
En savoir plus sur Ultrasound Imaging dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!