data = rand(N,2); %# generate random points
index = (rand(N,1) <= p); %# roll coins to pick with prob p
data(~index, :) = []; %# keep only selected points
plot(x(index),y(index),'r*');
dist=sqrt((data(1,1)-data(~index,1))^2+(data(1,2)-data(~index,2))^2); % ques is what to put for data(~index,:) 's first or any el...
I wonder in MATLAB how I would plot a circle and show it correctly instead of by default showing it as an ellipse. I guess it has something to do with the local coordinate system in the axis.
...
What is the best method for selecting design properties for a digital filter in Matlab with the GUI sptool? More specifically, if I have a signal, how do I go about determining which filter values will yield the best solution.
Example:
For my signal A:
One possible filter could have properties:
Design Method: FIR, Window
Window T...
I am little stuck on a problem. I have tons of files generated daily and I need to sort them by file name and date. I need to do this so my MATLAB script can read them. I currently do this manually, but was wondering if there is a easier way in MATLAB to sort and copy files.
My file names look like:
data1_2009_12_12_9.10
data1_2009_12_...
I want to run MATLAB code on the GPU using NVIDIA's CUDA. I found a couple of 3rd-party engines:
Jacket
GPUMat
Would anyone recommend these or are there better ones out there? Any tips or suggestions?
...
does matlab have the capability to catch signals from linux? for example, the signal SIGIO (29) can be sent to a process with a lease on a file when another process attempts to open that file. from my testing, when I try kill -s 29 pid, where pid is the process ID of a running matlab window, the matlab process is killed. similarly,kill -...
I’m trying to implement a Blind Source Separation (BSS) algorithm and I’m running into trouble determining the efficacy of the algorithm.
I’m trying to create test cases where I work backwards and start with a signal vector s, which is normally unknown, and then create a mixing matrix A, which I use to transform s to create the observa...
hello
i'm writing LZW in matlab,but i don't know how i should make dictionary?
i want some help in writing program.
thanks
...
Dear All,
I hope somebody here can help me with my problem.
I have matrix equation below:
[M] = [A][R] + [B][L]
where:
A and B = 2 by 2 matrices
M, R, L, and = 2 by 1 matrix.
To estimate one specific value of A and B, I have 9 different data of [M], [R], and
[L]. Let's say that these 9 data is one-group, and I have hundreds of gro...
I have noticed that matlab does some matrix function really fast for example adding 5 to all elements of an n*n array happens almost instantly even if the matrix is large because you don't have to loop through every element, doing the same in java the for loop takes forever if the matrix is large.
I have two questions, are there efficie...
I have a structure with many fields which are vectors of different lengths. I would like to access the fields within a loop, in order. I tried getfield as follows but MATLAB doesn't like that. How can I do this?
S = struct('A', [1 2], 'B',[3 4 5]);
SNames = fieldnames(S);
for loopIndex = 1:2
field = getfield(S, SNames(loopIndex));
...
Hi
I have some data points and their mean point. I need to find whether those data points (with that mean) follows a Gaussian distribution. Is there a function in MATLAB which can do that kind of a test? Or do I need to write a test of my own?
I tried looking at different statistical functions provided by MATLAB. I am very new to MATLA...
I was wondering if there was a way of using the Cell function rather than Range with MATLAB's ActiveX commands? Perhaps someone has a solution to my problem. I have many lists of data and all of varying sizes, for example:
List 1 has 10
List 2 has 13
List 3 has 3
...
I would like to take that data and export it to a new sheet in Excel...
I have a txt file with the following values on each line:
SRNO Value1 Value2
There are around 2000 such lines.
I would like to plot both Value1 and Value2 in MATLAB
Any code on how I could do it? Thanks
...
I have six parametric equations using 18 (not actually 26) different variables, 6 of which are unknown.
I could sit down with a couple of pads of paper and work out what the equations for each of the unknowns are, but is there a simple programatic solution (I'm thinking in Matlab) that will spit out the six equations I'm looking for?
...
Here's what I want to do:
Take 2x101 matrix for x and y coordinates and import that data in Dev C++ in program and use it for that code.
Right now my Dev code has
double Cord[NCargo][2] = {{x0,y0},{x1,y2},{...},{x100,y100}}
You get the idea. I want my .mat file matrix read into and put into this Cord Matrix. The name of my C+...
Say for n=5, the following code gives me a plot for n randomly generated nodes. These nodes are not structures (just plotted points), but I want to assign every node a message just as I did for sink and source and keep track of the nodes identity and location.
For example, if node 4 has (x,y) coordinates (.3452 , .5463), I want to assig...
I need to calculate the probability mass function, and cumulative distribution function, of the binomial distribution. I would like to use MATLAB to do this (raw MATLAB, no toolboxes). I can calculate these myself, but was hoping to use a predefined function and can't find any. Is there something out there?
function x = homebrew_binomia...
Hi friends,
I would like to know about loading .txt files in matlab. The vector data i have is given as a row for which i would like to calculate mean and other stats..
Kindly suggest me a way for that..
Thanks,
Aishwarya
...
Hi I am trying to generate random numbers in MATLAB with a random MEAN value.
For example, if I use
e = mean(rand(1000,1))
the answer for e will always be close to 0.5.
What I want is for the value of e (mean) to be random,
so that e can be 0.1, 0.2, 0.3, etc...
Is it correct for me to use
e = mean( unifrnd(0,1,[1000,1]) ) ?
Thanks...