g(x,y)=h(x​,y)*exp(2*​pi*Wx); what does this expresion means?

1 vue (au cours des 30 derniers jours)
ashok
ashok le 1 Fév 2014
Commenté : ashok le 1 Fév 2014
what does the expression means.basically what does the expression g(x,y) means ? here h(x,y)is a 2dimoensional guassian function .can any you help me in getting the code for matlab ?

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Fév 2014
Chances are that what you are looking at is a mathematical formula rather than some MATLAB code.
If it is intended to be MATLAB code, then it might be Symbolic Toolbox code.
If it is MATLAB code not intended to be Symbolic Toolbox code, then x and y would have to be nonnegative integer indices (but not necessarily scalars), and the code would read:
  1. If h is a function, then invoke the function passing in the two variables x and y. If h is an array instead of a function, then if any values in "x" or "y" are not positive integers, give an error; otherwise look in the array "h" at row #x column #y and retrieve the values there. In the array case, retrieve the combination of each value in x with every value in y, so h([1 2], [3 4 5]) would be h(1,3), h(1,4), h(1,5), h(2,3), h(2,4), h(2,5)
  2. multiply the constant 2 and the constant Pi
  3. if Wx is a scalar or vector or array, retrieve all of it. If Wx is a function, then call Wx passing in now arguments, and retrieve the result
  4. Multiply the result calculated in #3 by the constants calculated in #2; the result will be the same size as whatever was calculated in #3
  5. raise "e" to the exponents calculated by #4, resulting in something the same size as #4 (which in turn would be the same size as whatever Wx was)
  6. If either #1 or #5 resulted in scalars, then multiply all the elements of the other by the scalar and do not do anything further in this step. Otherwise, if #5 needs more than 2 dimensions to represent, give an error: matrix multiplication is not defined for more than 2 dimensions. Otherwise, compare the number of columns of the result of #1 to the number of rows of the result of #5, and if they are not equal, give an error: matrix multiplication is only defined if the "inner dimensions" match. If both checks are okay, then do an algebraic matrix multiplication (inner product) of the result of #1 with the result of #5, resulting in something that has the same number of rows as #1 and the same number of columns as #5
  7. if g is a function, then give an error: results can only be assigned to arrays. If g is a numeric matrix and #6 has any symbolic components then attempt to convert the contents of #6 to pure numeric form, failing if the contents of #6 involves any unresolved symbolic variables. If g is a numeric matrix with a different datatype than the contents of #6, convert the contents of #6 to the datatype that is already being used by g. If g does not exist then use the contents of #6 unchanged
  8. if any values in "x" or "y" are not positive integers, give an error: matrices cannot be indexed at 0 or negative or fractions. Otherwise if g is an existing matrix which is smaller than max(x) by max(y) then extend g to have at least max(x) rows and max(y) columns by filling g with 0 in all extension locations. Otherwise if g does not already exist then create it to have max(x) rows by max(y) columns, each filled with zeros of the same datatype as #7
  9. copy each value in #7 to the corresponding location in the array g as per #8
  10. Do not display the content of g after the assignment, because the semi-colon at the end indicates that it should not be printed. If the semi-colon were not there, then the contents of g after the previous operations would have to be formatted and displayed to the command window.
  1 commentaire
ashok
ashok le 1 Fév 2014
thank you thank you thankkk you soo much sir ..

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by