Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I want make a loop in which when i complete it's 5 turns then J =J+1. and repeat it until J does not approach to it's maximum given value ?

2 vues (au cours des 30 derniers jours)
Xinyue Lan
Xinyue Lan le 19 Nov 2018
Clôturé : Xinyue Lan le 20 Nov 2018
here i =1:5 and j=2:8
but, for eachtime when i arrive at 5, j=j+1
[(A(:,j).visited(i,:)]
end
  9 commentaires
Walter Roberson
Walter Roberson le 20 Nov 2018
assign to D{i,j}
however unless A has only one row and j is a scalar then you would get an indexing error . In matlab it is not possible to use a single statement to access a subset of an field inside a nonscalar structure array. You can have
scalar_structure
scalar_structure.fieldname
scalar_structure.fieldname(index)
nonscalar_structure
nonscalar_structure.fieldname
nonscalar_structure(index)
nonscalar_structure(index).fieldname
nonscalar_structure(scalar_index).fieldname(index)
but you cannot have nonscalar_structure(nonscalar_index).fieldname(index)
Xinyue Lan
Xinyue Lan le 20 Nov 2018
bro, actually A is a 1x9 struct with 2fields. size(A)= [1 9]. the output
for j=2:8
for i= 1:5
D=[A(:,j).visited(i,:)]
end
end
here D has a continous output of solution set each of (1-by-2), and i want store total solutions size=40x2 into D .
kindly help me regarding this

Réponses (0)

Cette question est clôturée.

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by