How to implement mathematical functions

조회 수: 2 (최근 30일)
Mehul Jain
Mehul Jain 2020년 4월 12일
댓글: Mehul Jain 2020년 4월 13일
I want to implement above mathematical functions, how can do this???
  댓글 수: 2
John D'Errico
John D'Errico 2020년 4월 12일
편집: John D'Errico 2020년 4월 12일
Yours is the kind of question that almost never gets a satisfactory answer on a forum. Why not? Its kind of a vague question, where it seems clear the asker does not really understand MATLAB that well. To a large extent, the answer needs to be to learn to use MATLAB.
We don't know what you have in the form of a function for nu. We don't know what your data looks like, and in what form it is stored. Sadly, we know absolutely nothing about what YOU know about MATLAB, partially because we see no effort made by you to try to solve your problem. When I see a fragment of MATLAB code written by someone, I can then judge their relative level of skill and knowledge about MATLAB. When I see no code at all, then I must assume this is a complete novice asking the question.
It would help if you gave a very clear, limited example, where we see in what form your data is stored, and where we see the answer you would have expected from that sample problem.
So what happens is nobody really knows what you are asking, but they can expect to enter into that conversation means someone would need to enter into a rather lengthy dialogue where they figure out what you have, and then try to teach you enough MATLAB to solve the problem. In the end, most people just glance at your question and then move on. So questions like this one tend to die unanswered, or they get approximate answers where people try to guess what you have.
Mehul Jain
Mehul Jain 2020년 4월 12일
Ok, I will try to improve it.

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

답변 (2개)

Ameer Hamza
Ameer Hamza 2020년 4월 12일
편집: Ameer Hamza 2020년 4월 12일
For first equation
V % your 3D matrix
V_mean = mean(v, 1:ndims(V))
v = sum((V-V_mean).^2, 1:ndims(V))
The second equation
V % your 3D matrix
s = -sum(V.^2.*log(1+V.^2), 1:ndims(V))

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato 2020년 4월 12일
Considering that nu is a function of x,y,z and you described it as a 3-dimensional matrix in your code you could implement then as follows:
nu = rand(10,10,10); % substitute by your nu
F1 = sum( (nu(:)-mean(nu(:))).^2);
F2 = -sum( ( nu(:).^2.*log(1+nu(:).^2)));

카테고리

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