How to change saved image size in Matlab

August 15, 2011

There is two ways to do this.

1. Use separate “set” command to change the output size

  • figure(1)
  • screen=[100,100,1536,864];
  • set(figure(1),’Position’,screen);
  • set(figure(1),’PaperPosition’,[0 0 8.5 11.0]; %usletter
  • set(figure(1),”PaperPositionMode’,'Auto’);

 2. Use figure command

  • screen=[100,100,1536,864];
  • figure1=figure(‘PaperPositionMode’,'Auto’,'PaperPosition’,[0 0 8.5 11.0],’Position’,screen)

Unix command ‘grep’

July 7, 2011

^ (Caret)        =    match expression at the start of a line, as in ^A.
$ (Question)     =    match expression at the end of a line, as in A$.
\ (Back Slash)   =    turn off the special meaning of the next character, as in \^.
[ ] (Brackets)   =    match any one of the enclosed characters, as in [aeiou].
                      Use Hyphen “-” for a range, as in [0-9].
[^ ]             =    match any one character except those enclosed in [ ], as in [^0-9].
. (Period)       =    match a single character of any value, except end of line.
* (Asterisk)     =    match zero or more of the preceding character or expression.
\{x,y\}          =    match x to y occurrences of the preceding.
\{x\}            =    match exactly x occurrences of the preceding.
\{x,\}           =    match x or more occurrences of the preceding.


CellArray in matlab

June 28, 2011

a={‘test’,'Test’} %creat cell array
b=[1 2;3 4;5 6];

c=cat(1,a,num2cell(b)); %combine two different cellarray

xlswrite(‘test2.xls’,c) %write to excel file


Histogram equalization

June 17, 2011

Learn how to write Matlab and Python script to equalize the histogram of the image.

Useful Matlab function call

  • nextpow2
  • intlut
  • im2gray
  • cumsum
  • cdfplot

Extract data from matlab fig

April 7, 2011

open(‘test.fig’)

h=gcf;

line=findall(h,’type’,'line’);

xdata=get(line(2),xdata);

ydata=get(line(2),ydata);


How to save text file in matlab

April 2, 2011

Use “csvwrite” or “dlmwrite” to write file

Use “csvread” or “dlmread” to read file

Or simply use “save” and “load”

http://www.mathworks.com/help/techdoc/ref/f16-5702.html#f16-14491


How to save fig or png in matlab

April 2, 2011

saveas(gcf,’test.png’)

saveas(gcf,’test.fig’)

openfig(‘test.fig’)


Get Cash For Your Used Power Macintosh G5 Dual Core 2.0GHz – gazelle.com

April 1, 2011

 

Get Cash For Your Used Power Macintosh G5 Dual Core 2.0GHz – gazelle.com


Get Cash For Your Used Power Macintosh G5 PowerPC 2.0GHz DP PCI – gazelle.com

April 1, 2011

 

Get Cash For Your Used Power Macintosh G5 PowerPC 2.0GHz DP PCI – gazelle.com


Get Cash For Your Used D70 Digital SLR Camera Body Only – gazelle.com

April 1, 2011

 

Get Cash For Your Used D70 Digital SLR Camera Body Only – gazelle.com


Follow

Get every new post delivered to your Inbox.