 
        0
    
    
    
        
        
        Declined
        
        
    
    
    
    
    
    arrayfun
is there a way to use arrayfun for mp? I need to define a function in integral form. but integral only uses scalar values in its limits. If I use loops it would be a little slower.
Customer support service by UserEcho
 Ideas
		
		
	
Ideas 
	
 
                
Toolbox provides arrayfun and it works with mp variables. Do you have any issues using it? Please provide minimal and reproducible example of the issue.
hello Mr. Holoborodko. for example this function I can create:
but with your toolbox:
>>mufun = @(x)arrayfun( @(x) quadgk(@(t) t,100*eps('mp'), x, 'RelTol', 100*eps('mp')), x);>>mufun(mp([1 2])) ans =
[1x1 mp] [1x1 mp]
however when I try to give scalar without arrayfun, it works:
mufun = @(x) quadgk(@(t) t,100*eps('mp'), x, 'RelTol', 100*eps('mp'));mufun(mp(2)) ans =
2.000000000000000000000000000000001
what does it mean when it displays [1x1 mp] ?
This means that function returned array of cells, each cell is a "mp" number.
There is nothing wrong with it, you can use/see the actual number by ans{1:2} or other indexing.
Why arrayfun returns the cell array in case of mp([1 2]) is a mystery, we will investigate it in more detail. I guess it is specific for non-standard types (like "mp").