Defining an anonymous function with 3*(N+1) variables
Afficher commentaires plus anciens
I need to define a function
f = @(X)...
where X has 3*(N+1) variables in the form: X(:,1), X(:,2), ... X(:,3*(N+1)) . The problem is that the expression for the function is very long. However, there is a pattern which I want to take advantage of.
The function is 

Notice that the function can be expressed in terms of summations and products. I want to take advantage of this fact so that I don't have to manually type out the products and sums. Is there any way of doing this using for loops?
4 commentaires
David Hill
le 8 Avr 2021
What is the X matrix or array? X(i+N+1) appears to exceed the array and X(i+2N+2) is much bigger than the array. Therefore without understanding what X and how you are indexing into it with i and j, I cannot help.
Anthony Gurunian
le 8 Avr 2021
Cris LaPierre
le 8 Avr 2021
Perhaps I'm getting hung up on symantics here, but it appears you have a single variable, X. Is it correct to say that your array X has 3*(N+1) columns?
Anthony Gurunian
le 8 Avr 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!