Error with uq_display


I’m pretty new to this software, alredy just managed to perform instalation and my first Bayesian inversion analysis on the simply supported beam. Problem is when I try to use the uq_display function on my analysis Object:

Undefined function or variable “Y”.

Error in uq_histogram (line 39)

Error in uq_scatterDensity (line 199)
currObj = uq_histogram(currSub, X(:,ii), histArg{:});

Error in uq_display_uq_inversion (line 258)

Error in uq_module/Display (line 50)

Error in uq_display (line 4)
% uq_createModel, uq_createInput or uq_createAnalysis commands. The

I dont have the necesary knowledge about the code in order to track what ‘Y’ stands for, so I was wandering wether anyone has encountered this same issue.

Thanks in Advance!

Hi Enrique!

Welcome to UQWorld! We tried to reproduce your problem, but we do not encounter the same issue when running the uq_Example_Inversion_01_Beam.

Could you possibly provide a minimum working example that causes UQLab to exit with the error you describe?

Hi! Thanks for your quick respond, here I’ve written a script that builds the model, performs the analysis, prints it and tries to plot it. The same error happens again but I’m suspicious the is a problem with my MatLab distribution (I’m currently using R2015 and I’ve checked that the statistics toolbox was installed). Maybe you can point me an error in my sintaxis.

I have also tried uq_Example_Inversion_01_Beam and the same error pops up so maybe there is some issue with my MatLab Instalation



%%% Model Definition

%Deflection at Mid Point
V_Mid = @(X) (5/32)*(X(:, 5).*X(:, 3).^4)./(X(:, 4).*X(:, 1).*X(:, 2).^3);

ModelOpts.mHandle = V_Mid;
ModelOpts.isVectorized = true;

myFowardModel = uq_createModel(ModelOpts)


%%% Variable definition:

PriorOpts.mFile = ‘uq_variables_Simply_Supported_Beam’;

PriorOpts.Marginals(1).Name = ‘b’; %Cross Section Width
PriorOpts.Marginals(1).Type = ‘constant’; Perfectly known PriorOpts.Marginals(1).Parameters = [0.15]; [m]

PriorOpts.Marginals(2).Name = ‘h’; %Height
PriorOpts.Marginals(2).Type = ‘constant’; Perfectly known PriorOpts.Marginals(2).Parameters = [0.3]; [m]

PriorOpts.Marginals(3).Name = ‘L’; %Lenght
PriorOpts.Marginals(3).Type = ‘constant’; Perfectly known PriorOpts.Marginals(3).Parameters = [5]; [m]

PriorOpts.Marginals(4).Name = ‘p’; %Uniform Load
PriorOpts.Marginals(4).Type = ‘Gaussian’; Normal distribution PriorOpts.Marginals(4).Moments = [0.012*1e3, 0.012*0.05*1e3]; N/m

PriorOpts.Marginals(5).Name = ‘E’; Young Modulus PriorOpts.Marginals(5).Type = 'LogNormal'; PriorOpts.Marginals(5).Moments = [30000*1e6, 4500*1e6]; Pa

myPriorDist = uq_createInput(PriorOpts)

%%% Data from measurements

VMeasured = [12.84; 13.12; 12.13; 12.19; 12.67]/1000;
myData.Name = ‘Deflection at Mid Point’
myData.y = VMeasured;

%%% Bayesian Analisis

BayesOpts.Type = ‘Inversion’;
BayesOpts.Data = myData;

myAnalysis = uq_createAnalysis(BayesOpts)


Hi Enrique

We tested this script (and the uq_Example_Inversion_01_Beam) on a R2015a MATLAB version and still could not reproduce the error. Thanks @damarginal for taking the time to install R2015a :blush:.

Maybe we can more easily pin-point the source of the error by looking at the returned error message. It looks like something went wrong inside uq_histogram:

Could you run the following script and let me know if MATLAB throws an error (and post the error message)?

x = randn(1000,1);

Problem Solved!
I have reinstalled MatLab and UQLab and managed to make the example and my code work. Guess some dependencies weren’t working.
Thanks for your patience and dedication