필터 지우기
필터 지우기

Writing math formula into the matlab

조회 수: 1 (최근 30일)
hamed
hamed 2016년 7월 19일
댓글: Thorsten 2016년 7월 19일
I try to write the below formula:
h=sum(H1(l*m)^r);
Is that true in your opinion?
Thanks for the help.
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2016년 7월 19일
your question is not clear
hamed
hamed 2016년 7월 19일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Thorsten
Thorsten 2016년 7월 19일
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
hamed
hamed 2016년 7월 19일
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 2016년 7월 19일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by