Plot from Mathematica to Matlab -
i have problem in mathematica :
l=16; f[x_]:=-x; mlat = table[2 randominteger[] - 1, {l}, {l}]; arrayplot[mlat, colorfunction -> (if[# == 1, white, black] &), mesh -> all]
and did in matlab:
l=16; f=@ (x) -x; mlat=2*randint(l,l)-1; if mlat(:,:)==1 plot(mlat,'ws') hold on else plot(mlat,'ks') hold off grid on end
but can't graph.
first, want create array ones , zeros, using randi
l = 16; mlat = 2*(randi([0,1],l,l)-0.5);
then, can display image (i open new figure every plot)
figure imshow(mlat,[]) %# [] scales min...max
to make image bigger, set axes size 90% of figure window
set(gca,'units','normalized','position',[0.05 0.05 0.9 0.9],'visible','on')
note axes label correspond index of matrix elements, (1,1) top left.
Comments
Post a Comment