From: Daniel Armyr on
Hi.
I use the data acquisition toolbox for most of my work. When doing measurements, I regularly save the entire workspace to make sure I have my original data intact even if there is a crash of some kind (my measurements sometimes go on for weeks).

I then do my signal cleanup and processing afterwards on the data stored on disk. This often begins with me loading up a handful of files. When I do that on another computer, I get this warning:

Warning: An error occurred when running a class's loadobj method. The object that
was loaded from the MAT-file was a copy of the object before the loadobj method was
run. The rest of the variables were also loaded from the MAT-file.
The encountered error was:
Error using ==> analoginput.loadobj at 93
Failure to find requested data acquisition device: nidaqmx.

Now, I know why I get the warning, it is because I don't have a DAQ-card on my office computer. What I wonder is if there is a way to disable the text output. My published reports regularly begin with a pagefull of these warnings, and that doesn't make for impressive presentations.

Sincerely
Daniel Armyr
From: Rob Purser on
You can capture the ID of any warning using LASTWARN, once you've got the ID, you can turn off any warning using WARNING. Example:

>> warning('matlab:exampleID','This is an example warning')
Warning: This is an example warning

>> [LASTMSG, LASTID] = lastwarn;

>> warning('off',LASTID)

% Note the warning is suppressed
>> warning('matlab:exampleID','This is an example warning')
>>
From: Daniel Armyr on
Thanks.
That worked like a charm!
From: Steven Lord on

"Rob Purser" <rob.purser(a)mathworks.com> wrote in message
news:hstpvs$nm9$1(a)fred.mathworks.com...
> You can capture the ID of any warning using LASTWARN, once you've got the
> ID, you can turn off any warning using WARNING. Example:
>
>>> warning('matlab:exampleID','This is an example warning')
> Warning: This is an example warning
>>> [LASTMSG, LASTID] = lastwarn;
>
>>> warning('off',LASTID)
>
> % Note the warning is suppressed
>>> warning('matlab:exampleID','This is an example warning')

Another alternative is to LOAD in just the variables containing the data
from the file (using WHOS -FILE to determine which variables are present in
the file, or determining the variables in which you're interested using the
naming system I'm assuming you used when you saved the data initially.)

For example, if I look at the demo MAT-file census.mat:

>> whos -file census.mat
% whos('-file', 'census.mat') % in function form

Name Size Bytes Class Attributes

cdate 21x1 168 double
pop 21x1 168 double

I see it contains two variables. If I only need the population data, I can:

>> S = load('census.mat', 'pop')

and I now have a struct array, S, with one field named pop. If you then
wanted to export just pop to a new MAT-file, you could then use SAVE on S
with the -struct option.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Daniel Armyr on
Handy.
I did not know that you could load selectively.

--DA