Dot indexing is not supported for variables of this type.

3 次查看(过去 30 天)
Why do I get that error? I am using the AI-mag FEM/ANN Code but when it comes to plotting the outcome, I get this error
  3 个评论
SOUKAINA JAAFARI
SOUKAINA JAAFARI 2024-2-23
@Torsten does this help now?
% Initialize the variable structure
var_inp = {};
% Add variables based on the model type
if any(strcmp(model_type, {'ht', 'mf'}))
% Inner radius
var_inp{end+1} = struct('name', 'rin', 'var_trf', 'none', 'var_norm', 'none', 'min', 0.75, 'max', 0.75); % Fixed value
% Number of turns
var_inp{end+1} = struct('name', 'N', 'var_trf', 'none', 'var_norm', 'none', 'min', 35, 'max', 35); % Fixed value
% Wire width
var_inp{end+1} = struct('name', 'wire_width', 'var_trf', 'none', 'var_norm', 'none', 'min', 4, 'max', 4); % Fixed value
% Distance between turns
var_inp{end+1} = struct('name', 'turn_distance', 'var_trf', 'none', 'var_norm', 'none', 'min', 4, 'max', 4); % Fixed value
% Air gap length (variable)
var_inp{end+1} = struct('name', 'airgap', 'var_trf', 'none', 'var_norm', 'min_max', 'min', 50, 'max', 250);
Torsten
Torsten 2024-2-23
编辑:Torsten 2024-2-23
You don't have a substructure with name "var_norm.min". All structure elements are at the same (first) level.
var_inp{1} = struct('name', 'rin', 'var_trf', 'none', 'var_norm', 'none', 'min', 0.75, 'max', 0.75); % Fixed value
var_inp{end}
ans = struct with fields:
name: 'rin' var_trf: 'none' var_norm: 'none' min: 0.7500 max: 0.7500
var_inp{end}.var_norm
ans = 'none'
var_inp{end}.min
ans = 0.7500
var_inp{end}.var_norm.min
Dot indexing is not supported for variables of this type.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by