Why my simulink Matlab Function block tell my that my matrix was not defined??
1 view (last 30 days)
Show older comments
Here is my simulink Matlab Function block code. Is there something wrong with my code? Cause it shows that 'y' is not defined.
function U = self_intern(u)
%#codegen
% in=imread('3.jpg','jpg');
% u=rgb2gray(in);
% u=in(:,:,1);
[a,b]=size(u);
y=zeros(2*a,2*b);
[X,Y]=meshgrid(1:b,(1:a)');
[XI,YI]=meshgrid(1:0.5:(b+0.5),(1:0.5:(a+0.5))');
y=interp2(X,Y,u,XI,YI,'nearest');
y(:,2*b)=y(:,2*b-1);
y(2*a,:)=y(2*a-1,:);
U=y;
% figure;
%
imshow(X)**
1 Comment
Ryan Livingston
on 18 Mar 2014
Could you please paste the text of the error in the question? The image isn't showing properly.
Answers (0)
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!