From: Sean on
Walter Roberson <roberson(a)hushmail.com> wrote in message <0s_0o.18055$0A5.13342(a)newsfe22.iad>...
> Sean wrote:
>
> > assert(all(size(WL)==size(master)),'Don''t be such a dumbass!!');
>
> Sean, what would happen if the two had a different number of dimensions?

It would fail :(
It could easily be remedied with another assertion:
assert(all(size(size(wl))==size(size(master))),'Your selections don''t have the same number dimensions!!'); %Note a more polite and helpful comment. Though rude comments are the best way to get a laugh out of your coworkers!
From: Sean on
"Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i21sh3$i8v$1(a)fred.mathworks.com>...
> Walter Roberson <roberson(a)hushmail.com> wrote in message <0s_0o.18055$0A5.13342(a)newsfe22.iad>...
> > Sean wrote:
> >
> > > assert(all(size(WL)==size(master)),'Don''t be such a dumbass!!');
> >
> > Sean, what would happen if the two had a different number of dimensions?
>
> It would fail :(
> It could easily be remedied with another assertion:
> assert(all(size(size(wl))==size(size(master))),'Your selections don''t have the same number dimensions!!'); %Note a more polite and helpful comment. Though rude comments are the best way to get a laugh out of your coworkers!

You could one-line it with:
assert(isequal(size(wl),size(master)),'The sizes are not the same');
Though it's probably more helpful for error tracking purposes to have two with more descriptive messages.
From: Maxx Chatsko on
"Andy " <myfakeemailaddress(a)gmail.com>
> It seems like an awfully clunky approach to have your user type file names exactly into an Excel file and then try to match those against a database. Is there any reason you're not using uigetfile or some similar approach?

The images are opened based upon the user selection in a listbox. Since multiple images are opened (up to 15) and have their spectral data averaged and displayed on the same plot, isn't it the best way???
Maxx

And thanks for the help Sean, Walter, and us. I did not use the assert function, but it lead to the right answer. Unfortunately, I did tone down my message. Which leads me to another syntax error...how can I incorporate sprintf into the error dialog multiple times? I'm working on it now - just need sprintf with ~tab~ to work on the two lines shown...
if rows==0;
errordlg(sprintf{'No %s data on file. Troubleshoot:',tab} char(10)...
{' 1) Update PSL Master Sheet with latest data' char(10)...
' 2) Check spelling of filenames in PSL Master Sheet ' char(10)...
}sprintf{'Please uncheck %s box to continue.',tab}),'FCI Data Error');
return
From: Walter Roberson on
Maxx Chatsko wrote:
> Which leads me to another syntax error...how can I
> incorporate sprintf into the error dialog multiple times? I'm working on
> it now - just need sprintf with ~tab~ to work on the two lines shown...
> if rows==0;
> errordlg(sprintf{'No %s data on file. Troubleshoot:',tab}
> char(10)... {' 1) Update PSL Master Sheet with
> latest data' char(10)... ' 2) Check spelling of
> filenames in PSL Master Sheet ' char(10)...
> }sprintf{'Please uncheck %s box to
> continue.',tab}),'FCI Data Error');
> return

You can represent the tab character in an sprintf format by the
character pair \t

Each sprintf call needs () around its arguments. You can include several
lines of error dialog by using {} around the list.

errordlg({sprintf('No %s data on file. Troubleshoot:', tab) ...
sprintf('\t1) Update PSL Master Sheet)' });


I am not certain, though, that \t will produce more than a small bit of
empty space for errordlg() purposes.
From: Maxx Chatsko on
Walter Roberson <roberson(a)hushmail.com> return
> You can represent the tab character in an sprintf format by the
> character pair \t
>
> Each sprintf call needs () around its arguments. You can include several
> lines of error dialog by using {} around the list.
>
> errordlg({sprintf('No %s data on file. Troubleshoot:', tab) ...
> sprintf('\t1) Update PSL Master Sheet)' });
>
>
> I am not certain, though, that \t will produce more than a small bit of
> empty space for errordlg() purposes.

I'm sorry, tab is a variable that represents an acquisition type (fci, rci, or swir). The problem is with char(10). It doesn't seem to like being on either side of (),{}...
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: function
Next: text not saving from figure