|
On Feb 8, 6:48 am, "Alex " <ala...@yahoo.com> wrote:
> Dear all I would like to map functions to variable names.....
> I will try to explain you what I want to do so we can discuss if it makes sense what I am trying to.
>
> Lets say that I have the following 4 functions
> function name: Psi_h returns the H matrices from 1 to i (there is a function that gives the H)
> function name: Psi_g returns the G and the H matrices from 1 to i-1 (function also returns G)
>
> then I want to calculate the
>
> Psi_h_h which will be the Psi_h (Kronecker Product) Psi_h
> Psi_h_g which will be the Psi_h (Kronecker Product) Psi_g
> Psi_g_h which will be the Psi_g (Kronecker Product) Psi_h
> Psi_g_g which will be the Psi_g (Kronecker Product) Psi_g
>
> then I want to calculate the
>
> Psi_h_h_h
>
> ...and so on....
> is it possible to write then only the psi_h function ones and then have an easy way for calling those many times as needed?
>
> Regards
> Alex
Yes, of course, but not with silly names like Psi_g_h.
Use a matrix instead, after all that is what Matlab stands for: Matrix
Laboratory
Psi=zeros(2,2);
Psi(1,1) will be Psi_h_h
Psi(1,2) will be Psi_h_g
and so on
|