how can i write function with the picture which i attached to the question?

조회 수: 2 (최근 30일)
hadi me
hadi me 2021년 6월 23일
댓글: Image Analyst 2021년 6월 23일
hey people
have a good time
i have a problem over the function which i attached to this Question.
i would like to write the function which take 2 variables (e.g. t and o)
and compute rmse and r^2 coefficient
can you help me out over this problem?
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2021년 6월 23일
hadi - what have you tried so far? Please describe what you have attempted and discuss what problem or errors you are experiencing with your code.
hadi me
hadi me 2021년 6월 23일
I've tried 2 version of this problem
one of that, is:
function [term1 , term2] = stat(o , t)
term1=...
term2=...
end
but it didn't work
I would like to compute the error from 2 rows of input data
I have problem with matlab code.
can you help me?

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

답변 (1개)

Image Analyst
Image Analyst 2021년 6월 23일
Here's some help:
Also check out the sum() and sqrt() functions. To square, use the caret:
term1 = sum(O) ^ 2
Multiplication is * and division is /. Not hard. Just take it one term at a time:
term1 = ....
term2 = ....
denominator = ....
rSquared = ( (term1 - term2 * term3) / denominator) ^2
Or you can simply use the built in functions for mse() and corrcoef().
  댓글 수: 1
Image Analyst
Image Analyst 2021년 6월 23일
Sure we can help you but all you gave was a partial snippet of one of your attempts, which was just a partial snippet of my answer above:
function [term1 , term2] = stat(o , t)
term1=...
term2=...
end
It seems you forgot to upload your entire two code attempts so how can I comment on them? So I guess my answer stands as-is until you upload your code. Come on, you can do it, you're a smart engineer. It sounds like homework, and if so I'm sure your instructor didn't just say "See if someone in the Answers forum can do your homework problem for you."

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

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by