Dot indexing is not supported for variables of this type.

조회 수: 3 (최근 30일)
SOUKAINA JAAFARI
SOUKAINA JAAFARI 2024년 2월 23일
편집: Torsten 2024년 2월 23일
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