Matlab examples: Difference between revisions

From Cheaha
Jump to navigation Jump to search
(Created page with "<pre> s = 'XYZ'; ss = {}; %ss{1} = s; for idx = 1:400 ss{idx} = [s num2str(idx)]; end XYZ = []; for idx = 1:400 eval(['XYZ = [XYZ; ' ss{idx} '];']); end Z = XYZ...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<pre>




quick and dirty, display a list of 3D point curves as a surface.
<pre>


clear all
ExportScan
%%
s = 'XYZ';
s = 'XYZ';


Line 22: Line 26:
Z = XYZ(:,3);
Z = XYZ(:,3);


reshape(Z,481,400);
Z = reshape(Z,481,400);


[X,Y] = meshgrid(1:481,1:400);
[X,Y] = meshgrid(1:400,1:481);


surface(X,Y,Z,'EdgeColor','none')
surface(X,Y,Z,'EdgeColor','none')


</pre>
</pre>

Latest revision as of 19:20, 7 June 2011


quick and dirty, display a list of 3D point curves as a surface.


clear all
ExportScan
%%
s = 'XYZ';

ss = {};

%ss{1} = s;


for idx = 1:400
    ss{idx} = [s num2str(idx)];
end

XYZ = [];

for idx = 1:400
    eval(['XYZ = [XYZ; ' ss{idx} '];']);
end

Z = XYZ(:,3);

Z = reshape(Z,481,400);

[X,Y] = meshgrid(1:400,1:481);

surface(X,Y,Z,'EdgeColor','none')