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
Line 1: Line 1:
<pre>
<pre>


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


Line 22: Line 23:
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>

Revision as of 18:41, 7 June 2011


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')