Click to See Complete Forum and Search --> : help needed in matlab


sravan2003_2003
September 1st, 2004, 06:09 AM
Hi all ,

I am newbie in Matlab.I have a function which loads a image and reshapes it .

The code for the function is

function read_2D_ima()

[FileName,PathName] = uigetfile('*','Bitte Start File waehlen:')

% f=fopen('2345-107-216.ima','r');
f=fopen(FileName,'r');
fid=fread(f,'int16');
fclose(f);

fid2=reshape(fid,256,256);
B = imrotate(fid2,-90);
colormap(gray);
imagesc(B);
axis image
*******************************************************

But when I run it displays a menu,toolbar and some other things like zooming on and out etc etc which i have not written in the code.
I want to know how this is possible.I have written the code for just uploading the image and viewing it.

I hope you have understood my problem.

Any help in this regard will be appreciated.

Thanks,
Sravan

yiannakop
September 1st, 2004, 08:39 AM
These are the standard tools of any figure in matlab. To remove the toolbox you can do:

F = figure; % creates a new figure
..... % plot your image (anyway you like)
set(F,'MenuBar','none'); % makes the MenuBar invisible

Hope it helps.

yiannakop
September 1st, 2004, 10:09 AM
A question: Why do you read the image data like this? Using imread you can read any kind of format: bitmap, jpeg and any kind of image: grayscale, indexed, rgb etc.

sravan2003_2003
September 2nd, 2004, 11:15 AM
Hi Theodore,

Thanks very much for the reply.
I am new to matlab,so i am analysing the existing code.
If I come across any good forums in Matlab i will let you know.


Regards,
Sravan