Creating Table using MATLAB command

Please login with a confirmed email address before reporting spam

I want to create a table in COMSOL using MATLAB simulink. I have designed the model with various excitation in each iteration and created the model, however, i am unable to create table from this model for simple voltage, current and resistance calculation.

It is giving an error as **An object with the given name already exists.

- Tag: eval1**

even though I have created an array of eval_param.

please help me to solve this issue:

for i = 1:9 eval_param = sprintf('eval%d', i); tbl{i} = sprintf('tbl%d', i); vol_name = sprintf('mf.VCoil_coil_%d', i); cur_name = sprintf('mf.ICoil_coil_%d', i); res_name = sprintf('mf.RCoil_coil_%d', i);

V_name = sprintf('Coil %d voltage', i);
I_name = sprintf('Coil %d current', i);
R_name = sprintf('Coil %d resistance', i);


% Create numerical evaluation

model.result.numerical.create(eval_param, 'EvalGlobal');

model.result.numerical(eval_param).label(eval_param);
model.result.numerical(eval_param).set('probetag', 'none');
model.result.numerical(eval_param).set('expr', {vol_name, cur_name, res_name});
model.result.numerical(eval_param).set('descr', {V_name, I_name, R_name});

% Create table
model.result.table.create(tbl{i}, 'Table');
model.result.table(tbl{i}).comments(['Global Evaluation', num2str(i)]);
model.result.numerical(eval_param).set('table', tbl{i});
model.result.numerical(eval_param).setResult;

end


0 Replies Last Post 2024年2月28日 GMT-5 16:43
COMSOL Moderator

Hello Poonam Chand

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.