Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

pleas help me where is the problem
>> F = imread("E:\PELAJAR\Unnes\PC\citra-grayscale2.jpg");
[tinggi, lebar] = size(F);
sudut = 5; % Sudut pemutaran
rad = pi * sudut/180;
cosa = cos(rad);
sina = sin(rad);
F2 = double(F);
m = floor(tinggi / 2);
n = floor(lebar / 2);
for y=1 : tinggi
for x=1 : lebar
x2 = (x-n) * cosa + (y-m) * sina + n;
y2 = (y-m) * cosa - (x-n) * sina + m;
if (x2>=1) && (x2<=lebar) && ...
(y2>=1) && (y2<=tinggi)
% Lakukan interpolasi bilinear
p = floor(y2);
q = floor(x2);
a = y2-p;
b = x2-q;
if (x2==lebar) || (y2 == tinggi)
G(y, x) = F(y2, x2);
else
intensitas = (1-a)*((1-bF(p,q) + ...
b * F(p, q+1)) + ...
a *((1-b)* F(p+1, q) + ...
b * F(p+1, q+1));
G(y, x) = intensitas;
end
else
G(y, x) = 0;
end
end
end
G = uint8(G);
figure(1); imshow(G);
clear all;
b * F(p+1, q+1));
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check
for mismatched delimiters.

1 个评论

MATLAB has already underlined the syntax error for you:
Always pay attention to the syntax checking, it helps you.

请先登录,再进行评论。

 采纳的回答

I think that line should be like this:
intensitas = (1-a)*((1-b)*F(p,q) + ...
b * F(p, q+1)) + ...
a *((1-b)* F(p+1, q) + ...
b * F(p+1, q+1));
In other words, bF should be b)*F

更多回答(0 个)

产品

版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by