필터 지우기
필터 지우기

Getting this error: Unrecognized field name "absolut".

조회 수: 3 (최근 30일)
Dhaval
Dhaval 2023년 7월 15일
댓글: Image Analyst 2023년 7월 17일
for i = 1: length(selected_list)
Speicher_Ort =Bracket_seperation(selected_list{i});
row = Speicher_Ort(1);
col = Speicher_Ort(2);
if strcmp(plot_data_type,'X')
plot(percentage * CEU_X(row,col).absolut(2,1:8000),...
percentage * CEU_X(row,col).absolut(1,1:8000),'r');
hold on;
end
end
Actually this code works perfectly before but suddenly I am geeting this error. please let me know, why i am getting this error?
  댓글 수: 5
Dhaval
Dhaval 2023년 7월 17일
편집: Dhaval 2023년 7월 17일
yes, field name is correct.
plot(percentage * CEU_X(row,col).*absolut(2,1:8000),...
percentage * CEU_X(row,col).*absolut(1,1:8000),'r');
after using this I got this error : Operator '*' is not supported for operands of type 'struct'.
Dyuman Joshi
Dyuman Joshi 2023년 7월 17일
Can you attach the variable CEU_X? Use the paperclip button to attach the file.

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

채택된 답변

Image Analyst
Image Analyst 2023년 7월 15일
CEU_X evidently does not have a field called that. What does this show
whos CEU_X
CEU_X
if you type those into the command window.
  댓글 수: 2
Dhaval
Dhaval 2023년 7월 17일
It is Struct.
Image Analyst
Image Analyst 2023년 7월 17일
What does this show in the command window
fieldnames(CEU_X)
when you type that in the command window or put it into the script before the error?
If absolut is a field, then you can do
percentage * CEU_X(row,col).absolut(2,1:8000)
like you originally did but not
percentage * CEU_X(row,col).*absolut(2,1:8000)
like you did later.
percentage * CEU_X(row,col).absolut(2,1:8000) says you're taking elements 1-8000 of row 2 of the field absolut of the structure CEU_X, where as CEU_X(row,col).*absolut(2,1:8000) says you're going to take a whole cell (not the contents of the cell like you'd get if you had used curley braces) and then multiplying it by absolut (an 8000 element row vector). You can't multiply a cell by anything. You can only multiple contents of cells if they are numbers. See the FAQ for info on when to use braces, brackets, and parentheses:

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by