フィルターのクリア

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 Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by