From: nurul on
hi everyone..

im new in gui matlab.. i got problem in loading the .mat file.
there are several .mat file that being needed for the calculation which it contains data.

and the function to calculate n compare the file class is like this.

..
..
..
testlogliknpVSp=mhmm_logprob(b(:,:),priornp,transmatnp,munp,Sigmanp,mixmatnp);%NOPAIN MODEL
testloglikpVSp=mhmm_logprob(b(:,:),priorp,transmatp,mup,Sigmap,mixmatp); %PAIN MODEL
if testloglikpVSp > testlogliknpVSp
..
..
..

all the priornp, priorp, transmatnp,transmatp, etc need to read all the .mat file.

--->so the question is, how do i load the .mat file(there are 12 files)
so that priornp,transmatnp,munp,Sigmanp,mixmatnp,etc can work fine and read the data? i dont want to use uigetfile to load all the 12 .mat files. and my previous load codes didnt work. please someone help me.

any kind help is so much appreciated
From: Jan Simon on
Dear nurul,

Submitting a post 5 times is a record, as far as I remember.

> im new in gui matlab.. i got problem in loading the .mat file.

I do not see the relation to any GUI.

> there are several .mat file that being needed for the calculation which it contains data.

> testlogliknpVSp = mhmm_logprob(b(:,:), priornp,transmatnp,munp,Sigmanp,mixmatnp);%NOPAIN MODEL
> testloglikpVSp = mhmm_logprob(b(:,:), priorp,transmatp, mup, Sigmap, mixmatp); %PAIN MODEL
> all the priornp, priorp, transmatnp,transmatp, etc need to read all the .mat file.

This code is not meaningful for the readers.

> --->so the question is, how do i load the .mat file(there are 12 files)
> so that priornp,transmatnp,munp,Sigmanp,mixmatnp,etc can work fine and read the data? i dont want to use uigetfile to load all the 12 .mat files. and my previous load codes didnt work. please someone help me.

If you previous load codes didn't work, post them together with a description of the errors (e.g. error message or difference between expectations and results). "Didn't work" and the rest of your post does not contain enough (any) information, which could help us to solve your problem.

In general: Load MAT files with the LOAD command.
S1 = load(FileName1);
S2 = load(FileName2);
... etc
Then access the variables of the Mat-files as fields of the structs S1, S2, ...

Kind regards, Jan
From: nurul on
thank you so much jan..


can i ask, one more thing?

by right, i have loaded the mat files, its working and read the variables in the workspace.
and i have an input(wav file) to be verified, therefore , i assign it to the function to execute the calculation. but then, it says the input is not a scalar. therefore, i make the variable as a scalar, and it says matrix dimension must agree.
any idea why does this happening?
From: Walter Roberson on
nurul wrote:

> by right, i have loaded the mat files, its working and read the
> variables in the workspace.
> and i have an input(wav file) to be verified, therefore , i assign it to
> the function to execute the calculation. but then, it says the input is
> not a scalar. therefore, i make the variable as a scalar, and it says
> matrix dimension must agree.
> any idea why does this happening?

It sounds as if you might be passing the file *name* instead of the
_content_ of the file.
From: nurul on
owh. hehe. how do i pass the content?
i use evalin. so it means it didnt work(but when i test, it seems to reading). can u give me rough idea on the codes how to pass the variable/content please? thank you..