splitapply with @num2str
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Kayla Black
 am 3 Jun. 2020
  
    
    
    
    
    Kommentiert: madhan ravi
      
      
 am 4 Jun. 2020
            I need to figure out how to set the precision of all numbers of a column in a table to 0.0 (i.e I have a value 34 that needs to output as 34.0). My professor has suggested using num2str is easier that sprintf for this matter. We have been learning about splitapply, so I thought maybe he intends for us to use that here. The table is from an excel file that I read in. Ergo, I have the following code:
table1 = table(Verb, meanEstimates);
meanEstimates = splitapply(@num2str, meanEstimates, '.1d');
I get the follow error message "Group numbers must be a vector of postitive integers, and cannot be a sparse vector."
In all honesty I don't really know what I'm doing because it's been hard to learn online this quarter.
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Tables finden Sie in Help Center und File Exchange
			
	Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


