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.

Load the MATLAB function to the COMSOL

Please login with a confirmed email address before reporting spam

I am recently trying to load the MATLAB function to the COMSOL.

The function has only 1 Argument. On the MATLAB setting, the lower and upper limits were set for 300 and 400 respectively. Then, I clicked on 'Plot' and wish to generate the distribution curve from the function. However, the error message show 'Incorrect size of returned vector. 42 elements were expected, but the returned matrix was 1x70'.

I was expecting a 1x70 data size will be produced from 1 input. Since I set the lower and upper limit for this function, therefore, I should expect n sets of distribution curves are produced which you can see from uploaded Picture 1.

Therefore, that would be great if you could advise me on this. Thank you very much.



2 Replies Last Post Oct 6, 2021, 10:43 a.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 6, 2021, 10:11 a.m. EDT

Hi Xin Tai

Please post your function.

-------------------
Lars Gregersen
Comsol Denmark
Hi Xin Tai Please post your function.

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 6, 2021, 10:43 a.m. EDT
Updated: 3 years ago Oct 12, 2021, 5:59 a.m. EDT

Hi Lars,

Please find the fucntion in the attached. Thank you very much.

Looking forward to your reply.

Hi Lars, Please find the fucntion in the attached. Thank you very much. Looking forward to your 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.