You can use use cell array and write those elements in string form. Read any desired string and assign them in an inline function and evaluate it with the desired value.
For example in your case,
>>Matfun= {'2*x^2+5', '3*x^3+7*x^2+3'; '4*x^5+9', '6*x+4'};
to evaluate the expression in first row and the second column,
>>f=inline(Matlfun{1,2});
>>f(4) % evaluating '3*x^3+7*x^2+3' at x=4
ans =
307
Yumnam Kirani Singh
Tronglaobi Awang Leikai
"Dinesh Bhati" <bhatidinesh@gmail.com> wrote in message <if9sfq$oh6$1@fred.mathworks.com>...
> Dear All,
> How can a matrix of functions like
>
> Matfun= [2*x^2+5 3*x^3+7x^2+3
> 4*x^5+9 6*x+4]
> Can be evaluated using a for loop for any value of x for e.g. x=4;
>
> I Want to know, is it possible to create a matrix of functions and if it can be accessed in a for loop like
>
> X=4;
> For i=1:2 for j=1:2 val(I,j)=matfun(I,j) …………… end; end;
>
> or if there is any other way
>
> Thanks,
> Dinesh
