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 Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by