matlab

In need of a good MATLAB class tutorial

I'm having a lot of trouble trying to figure out how to use classes in MATLAB. I'm very familiar with C++ and Python but I just can't figure anything out about how to define classes in MATLAB. Does anyone know a very good resource with lots of examples? The official documentation leaves much to be desired. ...

How to terminate a running process in matlab ?

I have a pretty simple question: how can I terminate a running script in matlab using code, similar to using CTRL + C? I want the program to stop running if a user enters incorrect digits. ...

Out-of-memory algorithms for addressing large arrays

I am trying to deal with a very large dataset. I have k = ~4200 matrices (varying sizes) which must be compared combinatorially, skipping non-unique and self comparisons. Each of k(k-1)/2 comparisons produces a matrix, which must be indexed against its parents (i.e. can find out where it came from). The convenient way to do this is to...

How can I count the number of elements of a given value in a matrix?

Does anyone know how to count the number of times a value appears in a matrix? For example, if I have a 1500 x 1 matrix M (vector) which stores the values of weekdays (1 - 7), how could I count how many Sundays (1), Mondays(2), ... , Saturdays(7) are stored in M? ...

How to change Matlab program for solving equation with finite element method?

I don't know is this question more related to mathematics or programming and I'm absolute newbie in Matlab. Program FEM_50 applies the finite element method to Laplace's equation -Uxx(x, y) - Uyy(x, y) = F(x, y) in Omega. How to change it to apply FEM to equation -Uxx(x, y) - Uyy(x, y) + U(x, y) = F(x, y)? At this page: http://sc.fsu.edu...

Calling MATLAB functions from python

Hi, Is it possible to run MATLAB functions from within Python? I search the internet, I could only find PyMat. The bad thing is the compiled version only supports Python2.2 and I am using 2.6. So I tied to download the source code, so I can compile it for myself. But I cannot compile it, VC++ express seems not to have the necessary funct...

Percentage of white pixel

After performing processing I want to calculate the percentage of white pixels between this images after the change. I'm doing this: var = (int2str(nnz(Img2)) / int2str(nnz(Img1))) * 100; but it returns as result ] What's the problem ? ...

Extracting Filiform Areas using MATLAB

Hey, how can I extract filiform areas on the center of an image using MATLAB ? ...

Problem with grayscale image

Hey, When I try to show a grayscale image using : Img = imread('tr2.png'); subplot(111); imshow(Img); it does not appear as the original image. Where is the problem ? ...

What is the algorithm of Skeleton

Hey, This function bwmorph(Img,'skel',Inf) return the skeleton of a binary image. What I'm looking for is the algorithm used by this function to do it manualy ? ...

Binary image in Matlab

How can I know if an image read with imread is binary in MATLAB I did this : Img = imread(IMGsrc); T = Img== 1 | Img == 0; If min(min(T)) == ?????? imshow(T); end ????? = ?????? ...

vectorizing loops in Matlab - performance issues

This question is related to these two: http://stackoverflow.com/questions/2867901/introduction-to-vectorizing-in-matlab-any-good-tutorials http://stackoverflow.com/questions/2561617/filter-that-uses-elements-from-two-arrays-at-the-same-time Basing on the tutorials I read, I was trying to vectorize some procedure that takes really a lot ...

MATLAB Easiest way to assign elements of a vector to individual variables.

So let's say I have a vector p = [1 2 3]. I want a command that looks like this: [x y z] = p; so that x = p(1), y = p(2), and z = p(3). Is there an easy way to do this? ...

Using matlab and Time Series object (fints), how can I make an array of them?

I am getting stock prices from yahoo, and want to have each stock have its own time series data structure, but also don't want to have hundreds of variables, so naturally I would want to have an array, but when I do something like array = [stock1 stock2]; it actually merges the series together. How can I make a real array? Thanks, CP ...

matlab noninteger step indexing

So, I have a vector: k = 1:100; And I want to take 19 elements from it, which are roughly equally-spaced. So I write this: m = k(1:(99/18):end); This works great, except for a tiny problem: Warning: Integer operands are required for colon operator when used as index m = 1 7 12 18 23 29 34 40 45 5...

Plotting special function (Debye) in Matlab

Hi, I'm trying to plot two functions. One is a Debye function in Matlab multiplied by some other stuff and the other is a regular function. How do I do this? Does Matlab have a toolbox for this? ...

Matlab and .NET Interaction

Hi All! I'm having an issue interacting between Matlab and .NET. I've managed to call .NET methods from Matlab code and vice versa. However, if I call a .NET method that, in turn, instantiates a Matlab object, it crashes (with a type initialization exception). Think about this scenario: a .NET assembly is interacting with a Matlab dll...

Small eps figure size in Matlab

Hi, How to create a small eps file from a Matlab figure? I use LaTeX and the eps that I'm getting with Matlab (R2010a) is of the order 6 MB. How to set the plot options to give an eps figure of smaller size? Does the render options painters or zbuffer help? Thanks a lot... One additional info: I use Laprint to generate my eps figur...

How to read an word document in matlab

Can we read an word document(.doc) by an command fopen in matlab 6.1? If No please provide some information about the same. ...

Undefined Variable in Matlab

The Following is the basic skeleton for my MATLAB program. Each box is a class definition. Scroll down for the error. Note: 1. Each Class has a custom constructor The Error Undefined function or variable 'Troom'. Error in ==> wall>wall.wall at 31 function o = wall(Tr) Error in ==> mainfile at 5 w1 = wall(); Thi...