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.

MATLAB Function and Automating M-Script File with Comsol: mphinterp Command

Please login with a confirmed email address before reporting spam

I have used the command syntax: mphinterp(model,'p','coord',coord1a) to extract pressure values at the stated coordinates:
coord1a=[x1;y1].
The study is in 2D; but I have been getting an empty matrix message. Please, is there something wrong in my approach?


5 Replies Last Post May 31, 2016, 4:08 a.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 30, 2016, 5:41 a.m. EDT
Hi

You code looks OK.

You should check your model and verify what dataset your results are placed in. Also verify that the model has in fact been solved ;-)

What are the values of x1 and y1? What is the dimension of your geometry?

Please quote any error messages you see. It makes trouble shooting so much easier.

--
Lars Gregersen
Comsol Denmark
Hi You code looks OK. You should check your model and verify what dataset your results are placed in. Also verify that the model has in fact been solved ;-) What are the values of x1 and y1? What is the dimension of your geometry? Please quote any error messages you see. It makes trouble shooting so much easier. -- Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 30, 2016, 10:47 a.m. EDT
Thanks Lars,

The model has been solved; and the dimension of the study is 2D.
x1, y1 are the coordinates of the point where the pressure is to be extracted from the domain. The error message reads:

Empty Matrix: 0 x 1

I have used the same syntax for a 3D COMSOL demo model (busbar), and the extraction was successful. But in this particular model, I have tried many extraction points and i'm still getting the same error message.
Thanks Lars, The model has been solved; and the dimension of the study is 2D. x1, y1 are the coordinates of the point where the pressure is to be extracted from the domain. The error message reads: Empty Matrix: 0 x 1 I have used the same syntax for a 3D COMSOL demo model (busbar), and the extraction was successful. But in this particular model, I have tried many extraction points and i'm still getting the same error message.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 30, 2016, 10:55 a.m. EDT
Empty matrix: 0-by-1
Empty matrix: 0-by-1

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 30, 2016, 2:15 p.m. EDT
I have found the cause of the error; as you mentioned earlier, to check the datasets. One of the datasets, which seems to be the default for extraction---dset1, had no solution.

Regards

Femi
I have found the cause of the error; as you mentioned earlier, to check the datasets. One of the datasets, which seems to be the default for extraction---dset1, had no solution. Regards Femi

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago May 31, 2016, 4:08 a.m. EDT
Hi

I'll see if we can add an error message for this case.



I have found the cause of the error; as you mentioned earlier, to check the datasets. One of the datasets, which seems to be the default for extraction---dset1, had no solution.

Regards

Femi





--
Lars Gregersen
Comsol Denmark
Hi I'll see if we can add an error message for this case. [QUOTE] I have found the cause of the error; as you mentioned earlier, to check the datasets. One of the datasets, which seems to be the default for extraction---dset1, had no solution. Regards Femi [/QUOTE] -- Lars Gregersen Comsol Denmark

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.