Difference between revisions of "MATLAB talk:Anonymous Function"

From PrattWiki
Jump to navigation Jump to search
m
 
Line 1: Line 1:
*{{Q}} I'm having trouble getting my anonymous function to return a matrix of answers. Specifically, I'm working on Lab3.4.4 (EGR53 Fall, 2010) which requires that you graph A=p*k*(1+k).^n / ((1+k).^n - 1) from n = 3:50. My anonymous function is >>AnnPay = @(p, k, n) p*k*(1+k).^n/((1+k).^n - 1)<<. When I prompt AnnPay(20000, .06, 3:50) or AnnPay(20000, .06, linspace(3,50,48)), rather than return a 1x48 matrix, it returns a single answer, which does not correspond to any of the individual n-values nor to any sort of mean or median value, as far as I can tell. Thanks for your help! [[User:Mwc11|Mwc11]] 01:09, 22 September 2010 (EDT)Max (mwc11)
+
 

Latest revision as of 16:59, 22 September 2010