what does thegrid{1}.points=(1:n); mean?
    4 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
Hello. I don't understand the underlined part. Can you please explain what is it doing?
thegrid=cell(1);
thegrid{1}.coordinate=zeros(p,1);
thegrid{1}.points=(1:n);
1 commentaire
  Walter Roberson
      
      
 le 28 Oct 2021
				Could you clarify what this has to do with python (that you tagged with) ?
Réponses (1)
  Dave B
    
 le 13 Oct 2021
        
      Modifié(e) : Dave B
    
 le 13 Oct 2021
  
      Cell arrays are containers for heterogenous data, each cell can hold arbitrary types/sizes/shapes. Cells are addressed with { }
The code creates a scalar cell array called grid
In the first (and only) cell in the grid, the code implicitly creates a struct. Structs are also containers that hold heterogenous data, but instead of indexing them by rows and columns it uses named fields. thegrid{1} has two fields: coordinate and points.
Inside thegrid{1}.coordinate theres a column of p zeros
Inside thegrid{1}.points are integers between 1 and n
Hope that helps, please let me know if you have more specific questions!
3 commentaires
  Dave B
    
 le 28 Oct 2021
				there are a lot of little expressions in there, can you clarify which part is confusing? A good tip in MATLAB is: start with one set of values (i.e. get out of the loop by setting i and j to be 1). break the code out into its statements (i.e. take each function one at a time), run them in the command window with no semicolon so you can see what the output is.
Voir également
Catégories
				En savoir plus sur Call MATLAB from Python 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!


