doubt in meshCanopy function
1 view (last 30 days)
Show older comments
Hello,
I have a problem while working with the meshcanopy function.(FIle Exchange)
I have the matrices x,y and z each of size 30x1. x & y are the X,Y coordinates and z represents the height of the coordinate at that point. I would like do something like a mesh/surf plot on an image so that at the respective coordinate i get a mesh/surf with the corresponding height)
This is the code I have used.
img = imread('C:\Documents and Settings\user\Desktop\sample.jpg'); //my image
//my x & y coordinates x = [180; 270; 120; 160; 225; 290; 335; 100; 150; 225; 305; 355; 95; 145; 225; 315; 360; 110; 150; 225; 305; 345; 125; 165; 225; 290; 330; 175; 225; 280]; y = [45; 45; 90; 105; 105; 105; 90; 145; 155; 155; 155; 145; 200; 200; 200; 200; 200; 260; 250; 250; 250 ; 260; 320; 310; 310; 310; 320; 360; 360; 360];
//height at x&y z = [1; 5; 6; 19; 18; 16; 16; 4; 16; 19; 23; 20; 6; 18; 21; 21; 13; 12; 12; 20; 21; 20; 11; 8; 23; 18; 17; 19; 20; 1]; xlin=linspace(min(x),max(x),30); ylin=linspace(min(y),max(y),30); [X,Y]=meshgrid(xlin,ylin); Z=griddata(x,y,z,X,Y,'cubic'); meshCanopy(img,Z)
I get the following error: ??? Error using ==> assert Too many input arguments.
Error in ==> meshCanopy at 39 assert(nargin==2||nargin==3||nargin==4,'The number of input arguments is expected to be 2, 3 or 4.\n It was %i',nargin);
What am I supposed to do?? How should I use the meshCanopy function????
Thanks in advance for the help.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!