Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Borna
Posts:
3
Registered:
9/2/12
|
|
Changing Scale in imagesc
Posted:
Sep 2, 2012 1:45 PM
|
|
Hi, I have a matrix (B) with a size of 2326*250 which by using the imagesc(B) shows me the image of it. The Y axis of it is shown by 1 to 2326 in an increment of 200 and the X axis from 1 to 250 with an increment of 50 which makes sense. However, I want to change the scales to the real values which are in mm rather than the index of the matrix. The real values start from 0 to 45 mm along Y axis and 0 to 100 mm along the X axis. I have tried changing the Y axis scale by using YThick and YTickLabel as shown below: B=load('Bimage.data'); imagesc(B), title('B-Mode Image'); colormap('jet'); set(gca,'YTick',200:200:2336) set(gca,'YTickLabel',{'4','8','12','16','20','24','28','32','36','40','44'})
But I want it to be automatic rather than labeling it like this. I know that the real values would be obtained by:
real_y_scale=(1:2336)*0.0192637; But it doesn?t work if I write: set(gca,'YTick', =(1:2336)*0.0192637) Could anyone please help?
|
|
|
|