0

It is a code snippet for implementing an effect like this: enter image description here

matlab code as following:

[u,v]=meshgrid(linspace(0,2*pi,50),linspace(0,2*pi,50));
x=(8+2.*(sqrt(abs(cos(u)).^pi./0.25+0.5*abs(sin(u)).^0.2)).*cos(v)).*cos(u);
y=(11+2.*(sqrt(abs(cos(u)).^pi./0.25+0.5*abs(sin(u)).^0.2)).*cos(v)).*sin(u);
z=-2.*sqrt(abs(cos(u)).^pi./0.25+abs(sin(u)).^0.2).*sin(v);
file = 'patcher.png';
I = imread(file);
figure;
warp(x, y, z, I);
axis off;
axis equal;
set(gcf, 'Color', [70/255 163/255 232/255]);
title('甜甜圈贴图', 'FontWeight', 'Bold', 'Color', 'w','FontSize',15);
view(0,90);

here is the 'patcher.png':
enter image description here

however here comes the error msg when it runs:

??? Previously accessible file "C:\MATLAB7\toolbox\images\images\warp.m" is now inaccessible.

Error in ==> Untitled at 8 warp(x, y, z, I);

ming
  • 427
  • 1
  • 5
  • 14
  • Does the error message appear in Matlab or did you compile and run it? BTW your image is not accessible. – Matthias W. Apr 08 '16 at 06:39
  • @MatthiasW. i upload it again . the message appears after I run the script. – ming Apr 08 '16 at 10:07
  • `warp` is a function from the image processing toolbox that was available well before R2006a. What does `which warp` in the command prompt give you? – rayryeng Apr 08 '16 at 13:44
  • @rayryeng it gave me `>> which warp C:\MATLAB7\toolbox\images\images\warp.m` – ming Apr 09 '16 at 12:59

0 Answers0