Filter löschen
Filter löschen

Writing math formula into the matlab

1 Ansicht (letzte 30 Tage)
hamed
hamed am 19 Jul. 2016
Kommentiert: Thorsten am 19 Jul. 2016
I try to write the below formula:
h=sum(H1(l*m)^r);
Is that true in your opinion?
Thanks for the help.
  2 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 19 Jul. 2016
your question is not clear
hamed
hamed am 19 Jul. 2016
This is my H Matrix in another function, that I will use this function into the another function:
function [H1,c,s,path,d,m]=topology1(topo) if (strcmp(topo,'access')) % This is for access-core H=zeros(24,18,3); H1=zeros(size(H,1),size(H,2),3); H1(:,:,1) = H(:,:,1);
So, I use the above function in below function:
function TrumpNew(topo,w) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This program solves the problem of Utility-Exp_cost with Trump by He et. % Today is 27 ,July %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [H1,c,ms,path]=topology1(topo); [l,r,m]=size(H1); maxc=max(c);
beta_p=1e-4; gamma=0.1; z1=(maxc/r)*ones(r,1); % initial the flow rate y=H1*z1; % initial the efficent capacity for the link / Why we don't z2=zeros(r,1); h=sum(H1(l*m)^r);
Cheers

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Thorsten
Thorsten am 19 Jul. 2016
It depends on the context, but your code is probably wrong. You have some variable H that seems to vary according to i, l and j. If you have set up your H such that l varies along a column, you can write
h = sum(H)
where j and l could are varying along the 2nd and 3rd dimension.
  2 Kommentare
hamed
hamed am 19 Jul. 2016
Thanks a lot for your answer. Actually, the H matrix is:
[l,r,m]=size(H1);
Which, I want to map r as i and m as j. In this case, could it be written as you have mentioned?
Cheers
Thorsten
Thorsten am 19 Jul. 2016
Yes. sum sums over the first dimension, which is l in your case. And that's what the formula says.
BTW:
S = sum(X,DIM) sums along the dimension DIM.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by