Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Changing Scale in imagesc
Replies: 2   Last Post: Sep 2, 2012 4:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Borna

Posts: 3
Registered: 9/2/12
Changing Scale in imagesc
Posted: Sep 2, 2012 1:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.