why do i get this error "undefined function"

Undefined function or variable 'RaR'.
Error in Untitled2>calculate_roughness_L1A (line 56)
rough_param(:,1)=RaR;
Error in Untitled2 (line 41)
[rough_param]=calculate_roughness_L1A(ca1);

6 件のコメント

Mehmed Saad
Mehmed Saad 2020 年 4 月 22 日
what is RaR, is this variable defined in your code?
Azhan Lazit
Azhan Lazit 2020 年 4 月 22 日
average roughness
Azhan Lazit
Azhan Lazit 2020 年 4 月 22 日
imtotally newbie in matlab, ijust want to calculate roughness from image
Mehmed Saad
Mehmed Saad 2020 年 4 月 22 日
suppose average roughness in 0.7
RaR = 0.7;
rough_param(:,1)=RaR;
Azhan Lazit
Azhan Lazit 2020 年 4 月 22 日
編集済み: Adam Danz 2020 年 4 月 22 日
i=1
RaR(i)=sum(sum(abs(roughness(:,:,i))))/n;
this what i write before that code
Adam Danz
Adam Danz 2020 年 4 月 22 日
編集済み: Adam Danz 2020 年 4 月 23 日
Please provide the complete section of code starting where RaR is defined and ending at the line that causes the error.

サインインしてコメントする。

回答 (1 件)

Adam Danz
Adam Danz 2020 年 4 月 22 日

0 投票

RaR could be a variable or a function, we don't know and neither does Matlab but you probably know whether it should be a function or a variable.
Either way, it's not defined. If I ask you A=5, A+B = ?? you couldn't answer it because you don't know what B is.
if RaR is a variable, give it a value.
RaR = [whatever];
If RaR is a function saved to an m-file, make sure the m-file is on your matlab path. See
doc addpath

質問済み:

2020 年 4 月 22 日

編集済み:

2020 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by