why this code can't run in my PC but can run in another. it show error about "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters"

2 ビュー (過去 30 日間)
R=imread('test.png');
R=rgb2gray(R);
figure(1); imshow(R);
F=[0:255];
gamma1=0.6;
G1=(round(255*(F/255).^gamma1)
gamma2=0.4;
G2=(round(255*(F/255).^gamma2)
R2=uint8(zeros(size(R)));
R3=uint8(zeros(size(R)));
for i=1:numel(R)
R2(i)=G1(R(i)+1);
R3(i)=G2(R(i)+1);
end
figure(2); imshow(R2,[]);
figure(3); imshow(R3);
figure(4); plot(F,G1); xlabel('f(r,c)');ylabel('g(r,c)');
hold on
plot(F,G2);

回答 (1 件)

Sudhakar Shinde
Sudhakar Shinde 2020 年 11 月 3 日
Looks like bracket close ')' missing for G1 & G2:
G1=(round(255*(F/255).^gamma1))
G2=(round(255*(F/255).^gamma2))

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by