Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Setting a parameter to values from an imported table

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Hi there everyone,

I have an application in which I currently import a file which is used to define an interpolation function. I would like to modify the method in which this file is imported so that I can also use some of the data in the file to change a couple of parameters. I thought that perhaps I could also import the file in to a table and then use the values in the table to create a string and assign it to my parameters. Does anyone know a way to do this? I essentially want the differences between the minimum and maximum values of the first two rows. The method currently looks something like this:

model.func("int1").discardData();
with(model.func("int1"));
set("filename", "C:\\Users\\ngoldring\\Comsol\\Models\\data_import.txt");
set("fp_length", "X");
set("fp_width", "Y");
endwith();


where X and Y are the values in which I would like to grab from the table. I was hoping to be able to take the cells that they fall in and just add them. Is it the case that I just need to write a piece of code that will do this? Thanks for any input!

0 Replies Last Post 7 févr. 2017, 16:17 UTC−5
COMSOL Moderator

Hello Nicholas Goldring

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.

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.