How to use the parameters of other functions within the ‘cellfun’ function?
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Fercho_Sala
 el 29 de Abr. de 2021
  
    
    
    
    
    Comentada: Fercho_Sala
 el 29 de Abr. de 2021
            Hello guys, just a simple question. I don’t find the way how to use the parameters ‘movemedian’ , ‘lowess’ and so on .. belonging to the ‘smoothdata’ function inside the ‘cellfun’ , how can you do this? Thank you.
x=cellfun(@smoothdata,C1,('movemedian',100),'UniformOutput',false); %there is a mistake here calling the parameters for 'smoothdata'
0 comentarios
Respuesta aceptada
  Stephen23
      
      
 el 29 de Abr. de 2021
        
      Editada: Stephen23
      
      
 el 29 de Abr. de 2021
  
      f = @(a)smoothdata(a,'movemedian',100);
x = cellfun(f,C1,'UniformOutput',false);
9 comentarios
  Stephen23
      
      
 el 29 de Abr. de 2021
				
      Editada: Stephen23
      
      
 el 29 de Abr. de 2021
  
			If you want to keep pks, etc. to use after the loop then you will need to use indexing into some variable, e.g.:
N = numel(smt1);
pks    = cell(1,N);
locs   = cell(1,N);
widths = cell(1,N);
proms  = cell(1,N);
for cv = 1:N
    ..
    [pks{cv},locs{cv},widths{cv},proms{cv}] = findpeaks(..);
    ..
end
Más respuestas (0)
Ver también
Categorías
				Más información sobre Matrices and Arrays en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

