Matlab newbie - what is wrong with this script?

1 回表示 (過去 30 日間)
Alex
Alex 2013 年 3 月 27 日
I am just learning Matlab so go easy on me. Trying to figure out what is wrong with this script specifically under the "if" statement is where I seem to be having the most problems.
NUM=0;
for i=1:13
img(:,:,i)=read_LUM2;
if exist('Left','var')==0; {
Left=img;
Left(Left<400)=0;
Left(Left~=0)=1;
Left=logical(Left);
NUM=NUM+1;
L(NUM)=mean2(img(Left));
}
else {
Right=img;
Right(Right<400)=0;
Right(Right~=0)=1;
Right=logical(Right);
NUM=NUM+1;
R(NUM)=mean2(img(Right));
}
end
end
L=L(1:13)';
R=R(1:13)';
any help you can provide will be much appreciated!
Thanks!
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 27 日
編集済み: Azzi Abdelmalek 2013 年 3 月 27 日
What is the error message?

サインインしてコメントする。

採用された回答

per isakson
per isakson 2013 年 3 月 27 日
Remove the curly braces "{}" and try again.

その他の回答 (1 件)

Alex
Alex 2013 年 3 月 27 日
Thanks per isakson! That worked!

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by