How do I take the following equation and put it into Matlab form?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sree chak
am 3 Sep. 2020
Beantwortet: Walter Roberson
am 3 Sep. 2020
I am trying to evaluate an objective function and trying to figure out how to translate this into Matlab form.
I know I have to do a loop somewhere but just can't figure out how to start. Any guidance would be really really appreciated.
Essentially k = 1: 5 and j = 1:J and n = 1:N
3 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Sep. 2020
abs(Gkj - sum(f(c(1:N)) .* gkj(X(1:N))))
provided that f and gkj are vectorized functions.
If they are not, then
fv = @(C) arrayfun(@f, C);
gkjv = @(C) arrayfun(@gkj,C);
abs(Gkj - sum(fv(c(1:N)) .* gkjv(X(1:N))))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!