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 6 ott 2021, 10:43 GMT-4
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago 6 ott 2021, 10:11 GMT-4

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 6 ott 2021, 10:43 GMT-4
Updated: 3 years ago 12 ott 2021, 05:59 GMT-4

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.