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.

COMSOL programming

Please login with a confirmed email address before reporting spam

Hello,

I want to import XYZ coordinate file in .txt or .csv format for genrating interpolation curve. The coordinates file name will change for each iteraction (example: 1.txt, 2.txt, ...nth.txt). Can I write for loop for calling filename in comsol java script. Please help me.

thanks Kiran


1 Reply Last Post 30 dic 2020, 07:41 GMT-5
COMSOL Moderator

Hello Kiran Kabothu

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.


Please login with a confirmed email address before reporting spam

Posted: 4 years ago 30 dic 2020, 07:41 GMT-5

You can use method editer to import the data from .csv file. but the imported data is in string format. you need to convert the string to double. You can use following code for import the .csv file in COMSOL: String[][] data = readCSVFile("Path of the csv file");

You can use method editer to import the data from .csv file. but the imported data is in string format. you need to convert the string to double. You can use following code for import the .csv file in COMSOL: String[][] data = readCSVFile("Path of the csv file");

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.