matlab

What does padColor(:,:,1) mean in MatLab?

>> padColor = [1 1 1]; %# RGB triple for pad color padColor = reshape(padColor,1,1,3); >> padColor padColor(:,:,1) = 1 padColor(:,:,2) = 1 padColor(:,:,3) = 1 What does padColor(:,:,1) mean here? ...

Finding edge and corner values of an image in matlab

Hi, this problem links to two other questions i've asked on here. I am tracing the outline of an image and plotting this to a dxf file. I would like to use the bwboundaries function to find the coordinates of the edges of the image, find the corner coordinates using the cornermetric function and then remove any edge coordinates that are...

What's the difference between [A,B] and [A;B] in MatLab?

% CAT(2,A,B) is the same as [A,B]. % CAT(1,A,B) is the same as [A;B]. Seems I need to know this to understand what cat does. ...

Need some help understanding the MATLAB `cat` command in high dimensions

The commands a = magic(3); b = pascal(3); c = cat(4,a,b); produce a 3-by-3-by-1-by-2 array. Why is the result 3-3-1-2 when the dimension is 4? ...

Loops on a Matlab program

I have 3 sets of 10 vectors each, and I want to take 2 vectors from the first set , 2 vectors from the second set and 3 vectors from the third set . My goal is to make a loop to implement the following program, knowing that after each calculation, the result shall be saved in a new file. My problem is that I can not handle the indices in...

Getting data into MATLAB from HTTPS

Anybody know if it's possible? I'm trying to get the data by using the following code url = 'https://cgwb.nci.nih.gov/cgi-bin/hgTracks'; params = {'org','Human','db','hg18','position','EGFR'}; urltxt = urlread(url,'get',params); but get the error ??? Error using ==> urlread at 111 Error downloading URL. Your network connection may ...

What are the 3 dimensions of an RGB image in MATLAB?

[r,c,d] = size(rgbImage); %# Get the image dimensions What does r,c,d stand for here? ...

How to retrieve the background color of an arbitary image using MATLAB?

This is yet another questions springed from this one, How do I programatically get the background color of an image? Example: For the above image,the background color is white. ...

GCD function in matlab

hi, i am looking for a way to implement the "gcd" function used in matlab in another language but i really cant understand the way it functions. it says in http://www.mathworks.com/access/helpdesk/help/techdoc/ref/gcd.html that: "[G,C,D] = gcd(A,B) returns both the greatest common divisor array G, and the arrays C and D, which satisfy ...

How to merge a 64 by 64 cell into a 1 by 1 cell

I have a 64 by 64 cell and how do I merge it back into a 1 by 1 cell? Each cell is a 8 by 8 double. ...

How to segment text images using MATLAB?

It's part of the process of OCR,which is : How to segment the sentences into words,and then characters? What's the candidate algorithm for this task? ...

keyboard button number in Psychtoolbox - matlab

Hi I am looking for a table that will give me the number of the button (device number) so I could use KbCheck in matalb psychtoolbox. I am working with PTB-3 and windows XP Thnak you Ariel ...

Need help with artificial neural network

I have an input data for neural network that consists of 2 vectors with 200 elements, that i got from some program for generating signals. So it is actually 2x200 input to my nnet. As target data, i have one 1x200 vector that i also got from the same program. That is my training data set. I gather as much of those sets as i want so i tra...

C# app fails to load Matlab DLL when running from a shared drive?

I have a C# .NET 2.0 program that calls a Matlab .dll file that I created using Matlab Builder for .NET. This Matlab .dll file is a wrapper for a m file function that I need to call from my C# program. Everything works fine when I run this app from my local drive. However once I copy the app to a shared drive the Matlab dll fails when...

How can I access the JPEG image pixels as a 3D array like we do in MATLAB?

I want to process an image in C++. How can I access the 3D array representing the JPEG image as is done in MATLAB? ...

Accelerating wheel - psychtoolbox in MATLAB

I am trying to write a code that will show an accelerating wheel. As long as the user presses 'a' the wheel should accelerate counterclockwise. The thing is that it turns in the right direction but it doesn't accelerate. This is the code I am using (in PTB-3 and Windows XP): img=imread('c:\images.jpg'); [yimg,ximg,z]=size(img); rot_...

Snippets in matlab editor

Is there a way to incorporate in some way (suggestions welcome) snippets in matlab's editor. I just need static snippets feature, for standard and often used stuff (simple formatting, plotting and the like) ... Talking about matlab 2008b here; I don't know if the situation changed in the recent versions. ...

MATLAB: Reading floating point numbers and strings from a file

I am using the following functions for writing and reading 4098 floating point numbers in MATLAB: Writing: fid = fopen(completepath, 'w'); fprintf(fid, '%1.30f\r\n', y) Reading: data = textread(completepath, '%f', 4098); where y contains 4098 numbers. I now want to write and read 3 strings at the end of this data. How do I read ...

What's the best short cut for this in MATLAB?

padColor = [bgColor bgColor bgColor]; padColor = reshape(padColor,1,1,3); How to do the above in a more compact way(less code/replication)? ...

How do I solve this conditional probabilities problem with MATLAB?

If P( cj | xi ) are already known, where i=1,2,...n; j=1,2,...k; How do I calculate/estimate: P( cj | xl , xm , xn ), where j=1,2,...k; l,m,n {1,2,...n} ? ...