Failure to recognize the parameter when evaluating model

截屏2021-02-24 上午1.19.53
These are my code creating model, and try to evaluate it, but the X can not be recognized

Hi @Jeremie,

Welcome to UQWorld!

What is the actual error message and is there actually any X in the current MATLAB workspace?
Thanks!

No there is no X in the workspace. I created a input file to input number into a main code, and a inp.tpl file with , in it. Then the error says cannot recognize variable X.

The variable X as an input to uq_evalModel has to be available in the current workspace (be it the main or a function workspace) before you can call the function; otherwise UQLab (well, in this case, MATLAB) won’t know what X means. The function evaluates the model on actual input points (arrays), so calling uq_evalModel(X) means evaluate the points stored in variable X.

The template (*.inp.tpl) file in UQLink model is used as the basis for creating an actual input for your external model. The markers inside the template file will be substituted with the actual numbers from X when uq_evalModel is called. Again, the variable X and the numbers inside have to be defined first.

I hope this helps!

2 Likes

Thank you for your assistance, but after I replace the X with my actual input, the model did not reflect as it should be. Would you please send me an example which can successfully run for me to understand what the manual is saying about coding.

I believe the problem should be the function uq_readOutput, it did not correctly read the output of my model.
This is my screenshot of the function code. The uq_readOutput should have read the result from the BloodPressure.out. But it comes out to be NaN.
截屏2021-03-02 下午9.58.41