Re: Try-catch error in Matlab version 7.4



THANKS!
"Vadim Teverovsky" <vteverov@xxxxxxxxxxxxx> wrote in message <h5ho3v$co1$1@xxxxxxxxxxxxxxxxxx>...
You are trying to use a syntax which was introduced in R2007b in an earlier
version.
In R2007a, the catch syntax with a variable did not yet exist, although
there was the warning you are seeing which warned of its impending
introduction.

In R2007a, you need to replace the catch block with:
catch
disp(lasterror);
end

"Kaite " <kweider@xxxxxxxxxxxxx> wrote in message
news:h5hnrq$q56$1@xxxxxxxxxxxxxxxxxxxxx
I am trying to fix a try-catch syntax in an m-file...the error message
reads:
??? Warning: File: lowess.m Line: 297 Column: 11
This try-catch syntax will continue to work in R2007a,
but may be illegal or may mean something different in future releases of
MATLAB.
See Release Notes for MATLAB Version 7.4, "Warning Generated by try-catch"
for details.
although it says that it will continue to work I am not getting any
results....I would like to know hoe to fix it... this is the portion of
the m-file that has the try-catch issue....I tried to read the release
notes and fix it but i cant seem to get it to work....this is a known bug
in the 7.4 (R2007a) version......

function customplot(lws,uplmt,lwrlmt,f,imgfile)
% Plotting of data and lowess regression line
try
x = lws(:,1);
y = lws(:,2);
yh = lws(:,3);
plot(x,y,'d');
hold on
plot(x,yh, 'r-', 'LineWidth',2);

x = uplmt(:,1);
yh = uplmt(:,2);
plot(x,yh, 'r:', 'LineWidth',2);

x = lwrlmt(:,1);
yh = lwrlmt(:,2);
plot(x,yh, 'r:', 'LineWidth',2);

grid on
xlabel('x-values')
ylabel('y-values')
ts = strcat('LOWESS Regression plot f=',num2str(f));
title(ts)
hold off
if ~isempty(imgfile)
fprintf('\nCreating plot. Give a few tics.\n');
print('-dpng','-r600', imgfile);
fprintf('\nFinished...\n');
end
catch ME1
disp(ME1)
end
end
thanks!

.



Relevant Pages

  • Re: PI program again
    ... specifically the multiplication routines can be made faster than ... crtmath.h:22: warning: 'crtcopy32' defined but not used ... Since your file is chock full of inline assembly in GAS syntax, ... other compilers you mentioned. ...
    (comp.programming)
  • Re: (u8 a) = (u16) b
    ... if your compiler recognizes "#warning" (it's non-standard). ... It's in the syntax, and is described in 6.10p3, second ...
    (comp.lang.c)
  • Re: About directory
    ... I've tried with this syntax: ... Is the warning perhaps one of not being able to change the directory? ... Your code as written seems to only try to change dirs if it was *NOT* made. ...
    (comp.lang.php)
  • Re: Try-catch error in Matlab version 7.4
    ... You are trying to use a syntax which was introduced in R2007b in an earlier ... This try-catch syntax will continue to work in R2007a, ... % Plotting of data and lowess regression line ...
    (comp.soft-sys.matlab)
  • Re: [coding practises] do you declare your superclass "throws"??
    ... public static int foothrows IOException ... and compiled it with javac 1.5.0_09 and with 1.4.2_08 ... It could stand to give a warning in this case, or where it's final or private. ... and then having to also comment out the try-catch. ...
    (comp.lang.java.programmer)

Loading