matlab

how do you make plots with dates in matlab?

Possible Duplicate: Plotting data on time (date) axis in matlab hi, I have 2 column vectors in matlab (I imported the data from excel). the first one is called textdata which contains a list of dates and times as string format: textdata = '1/11/2010 11:40:04 AM' '1/12/2010 11:40:04 AM' '1/13/2010 11:40:04 AM' the ...

matlab: how to plot multidimensional array

Hello, Let's say I have 9 MxN black and white images that are in some way related to one another (i.e. time lapse of some event). What is a way that I can display all of these images on one surface plot? Assume the MxN matrices only contain 0's and 1's. Assume the images simply contain white lines on a black background (i.e. pixel valu...

MATLAB swap columns of two different matrices

Hi everyone, Im using matlab and am having some difficulty. I am trying to swap the columns of one matrix (A) with the column of another matrix (B). For Example: A = 4 6 5 7 8 4 6 5 9 1 0 0 0 1 0 0 0 1 B = 1 0 0 0 0 0 0 1 0 ...

MATLAB formatting a matrix

I am using MATLAB and having some issues formatting the output of a matrix. Currently, the matrix looks like: Columns 1 through 7 4 6 5 1 0 0 0 7 8 4 0 1 0 0 6 5 9 0 0 1 0 1 0 0 0 0 0 -1 0 1 0 0 0 ...

Eye tracking: finding the pupil (x,y)

Hello, I am looking for some suggestions on how to approach the following computer vision problem. Below are 4 samples of an eye tracking dataset that I am working with. I would like to write code takes one such image and calculates the (x,y) position of the center of the pupil. I am currently using MATLAB, but I am open to using other ...

Perspective correction by scaling factor in Matlab based on height or attitude

How do I compute the perspective correction by scaling factor in MATLAB based on height or attitude, i.e. assuming that when I am moving upwards, an area, say a square should shrink or expand if I were to descend. There are 2 scenarios for this: Case I: using imresize(), however how do I determine the scaling factor proportional to...

How to use other clustering methods for clustergram in Matlab's bioinformatics toolbox.

EDIT: I figured it out. Just did not understand notation. Hello, Hopefully someone out there is familiar with the clustergram in the bioinformatics toolbox. I am interested in the graphical aspects of the function (the dendrogram/heat map), but am currently handicapped as it requires me to use Matlab's cluster() function. I would prefe...

My preallocation of a matrix gives out of memory error in MATLAB

I use zeros to initialize my matrix like this: height = 352 width = 288 nFrames = 120 imgYuv=zeros([height,width,3,nFrames]); However, when I set the value of nFrames larger than 120, MATLAB gives me an error message saying out of memory. The original function is [imgYuv, S, A]= changeYuv(fileName, width, height, idxFrame, nFram...

Plotting evolution of 2D vector in 3D as a ribbon in MATLAB

I would like to plot how the amplitude and orientation of a 2D vector evolves over time. To do this I would like to create a graph reminiscent of the canonical E & B field graphs you may recall from an introductory electricity and magnetism class. Specifically, I would like to connect my 2D vector points with a ribbon, so that they ...

overlap between two patch plots

I have two patch plots on the same graph. One is red and the other blue. Is it possible to make the overlap purple? ...

only allow rotation of one subplot

I have two subplots. One is 3D and rotation is useful, but the 2nd is 2D and I keep accidentally rotating it which is really annoying. Is it possible to only allow rotation of one subplot? ...

Float to text behavior of MATLAB's fprintf()

When using fprintf to convert floats to text in a decimal representation, the output is a series of decimal digits (potentially beginning with 0). How does this representation work? >>fprintf('%tu\n',pi) >>1078530011 >>fprintf('%bu\n',pi) >>04614256656552045848 Apologies if this is very trivial; I can't find an answer elsewhere, in ...

MATLAB matrix not formatting correctly

Hi everyone, I have some code below, and I cant seem to get the matrices formatted correctly. I have been trying to get the matrices to look more professional (close together) with \t and fprintf, but cant seem to do so. I am also having some trouble putting titles for each columns of the matrix. Any help would be much appreciated! cle...

how to find middle point of a sorted array in matlab?

i have an arry lets say A=[2 3 4 5 6 7 8 9] i want to get middle point like B=[5] how to do it? ...

image pixel values storage in XML using Matlab

Hi ppl. I'm currently working on storing pixels in XML format using Matlab. The problem is that I have no idea about data storage under XML. Can any expert please give me some guidelines? Any relevant materials are welcome and appreciated. Thanks!! ...

Color filter in MATLAB

For this picture: How do I make filter that returns true on brown color (insect) and false on background? ...

MATLAB: How to change color of imhist and size of window?

I have: img = imread('pic.jpg','jpg'); r = img(:,:,1); g = img(:,:,2); b = img(:,:,3); subplot(3,1,1); imhist(r); subplot(3,1,2); imhist(g); subplot(3,1,3); imhist(b); How can I change colors of the histogram to Red, Green and Blue? How can I change size of window tha appears? EDIT: Luis Miguel's answer regarding size of window work...

MATLAB: Setting window/picture title

I have: img = imread('pic.jpg','jpg'); r = img(:,:,1); g = img(:,:,2); b = img(:,:,3); figure, imshow(r); figure, imshow(g); figure, imshow(b); How to set title over each picture? ...

MATLAB see if something is included in matrix

Hi, I am having issues manipulating a matrix. Any help would be much appreciated! Say I have a matrix: xb = 1.00 2.00 3.00 6.00 5.00 9.00 and another matrix: cb = 3000.00 4000.00 4000.00 0 0 0 Is there a way to code somet...

Simple MATLAB questions (about colon operator)

I am new to using MATLAB, and I came across some syntax about colon that I don't fully understand. First Question: The expression: 0:pi/4:pi results in the answer: 0 0.7854 1.5708 2.3562 3.1416 Why is this the case? I thought that colon operator is used as a quick way to refer to indices so that we don't have to write out...