i want make grid ( uniform mapping) in mathlab without meshgrid
i have make grid meshgrid want make boucle or second method ( without meshgrid )
this code using meshgrid :
figure(6) [x,y] = meshgrid(-1:0.1:1, -1:0.1:1) plot(x,y,'k-') hold on plot(y,x,'k-');
use repmat
, or multiply ones
vectors more basic functionality:
x = -1:0.1:1; y = -1:0.1:1; % repmat x1 = repmat(x(:)',[numel(y),1]); y1 = repmat(y(:),[1,numel(x)]); % multiply ones x2 = ones(numel(y),1)*x(:)'; y2 = y(:)*ones(1,numel(x)); % meshgrid [x3,y3] = meshgrid(x, y); isequal(x1,x2,x3) && isequal(y1,y2,y3) % true plot(x1,y1,'k'); hold on plot(y1,x1,'k');
Comments
Post a Comment