how to fix this error "Dot indexing is not supported for variables of this type"
33 ビュー (過去 30 日間)
古いコメントを表示
nuser = kernel_param.nuser;
nmovie = kernel_param.nmovie;
ndata = kernel_param.ndata;
this is my code and when i run this code, i get the following error,
""Dot indexing is not supported for variables of this type""
what does this error mean, and how to solve it, please
1 件のコメント
Allen
2022 年 5 月 24 日
@Waseem Abbas you should also provide some details on your data set to the kernel_param variable or a sample set of that data.
回答 (1 件)
Voss
2022 年 5 月 24 日
編集済み: Voss
2022 年 5 月 24 日
It means kernel_param is not a struct.
Here kernel_param is a struct, so it works fine:
kernel_param = struct('nuser',0,'nmovie',99)
nuser = kernel_param.nuser
nmovie = kernel_param.nmovie
And here kernel_param is not a struct, so you get that error:
kernel_param = [1 2 3]
nuser = kernel_param.nuser
How to solve it? Check where kernel_param comes from, and figure out why it's not a struct when it should be, or figure out why your code expects it to be a struct when it's not.
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!