Answered
Cogent and Matlab2013b compatibility?
The cogent toolbox is very old. It might simply not work with recent MatLab releases or even with windows newer than XP. You cou...

12 years ago | 0

Answered
How to store indexed values from a for loop
Like with C, you can store them in a cell array v = cell(size(C)) for j=1:numel(C) ... [K, v{j}] = convexH...

12 years ago | 0

| accepted

Answered
Giving names to different files automatically
Maybe you can use structures? MyStructure.A = 8 ; MyStructure.B = 1:5 ; MyField = 'A' result = 2 * MyStructure...

12 years ago | 0

Answered
Giving names to different files automatically
Rethink your programming style critically. The basic idea about variables is that their contents change during execution of the ...

12 years ago | 0

Answered
Cogent and Matlab2013b compatibility?
Have you added the folder with a all the functions to the matlab path? what does, for instance, which cgopen give you?

12 years ago | 0

Answered
Binornd draws '1' every time
what if you execute which binornd just before the calls? Do the outputs differ based on the situation (script vs. comman...

12 years ago | 0

Answered
How do I smooth a plot ?
You want to apply 2D (3D?) smoothing filters, which is quite easy if you have the signal processing toolbox. You can also search...

12 years ago | 0

Answered
Adding vertical line to plot?
You might also be interested in GRIDXY on the File Exchange: <http://www.mathworks.com/matlabcentral/fileexchange/9973-gridxy...

12 years ago | 0

Answered
find X of corresponding local minima
Finding minima of a signal X is the same as finding the maxima of the signal *-X*

12 years ago | 0

| accepted

Answered
Can someone give me a quick project to write?
Programming these games will learn you about flow control, contingencies, matrices, graphics, input validation, etc: (in order o...

12 years ago | 0

| accepted

Answered
create 3*3 matrix around a given pixel
One solution: img = zeros(6,7) a = [4 3] img(a(2),a(1)) = 1 B = [1 1 1 ; 1 0 1 ; 1 1 1]; img2 = conv2(img, B ,'...

12 years ago | 0

| accepted

Answered
Taking the mean of rows in a structure array
I assume NM is your 300 element structure array. with NM(k).data holding the 3453 data points of the kith element of the struct...

12 years ago | 0

Answered
Find numeric columns in a cell array
% C is a cell array, like C = {1 2 3 4 5 ; 11 '12' 13:15 14 []} q = cellfun(@(x) isnumeric(x) && numel(x)==1, C) % tru...

12 years ago | 1

| accepted

Answered
x and y intercepts
You want to fit a line to your x,y points and then solve the fitted line for y is zero and x is zero, giving you the x- and y-in...

12 years ago | 1

Answered
How do I use the results of the polyfit command for the rest of my code?
Useully you would like to use the parameters of the fit to obtained fitted values. Something along these lines, perhaps? x ...

12 years ago | 0

Answered
Generating random number between 1 to 10
In matlab you can directly loop over a vector (no need for indexing) V = randperm(10) % example vector for x = V %...

12 years ago | 2

Answered
convert time stamp into minutes or seconds
I assume the 3rd column represents a value. [D,T,V] = textread('MyFile.txt','%s%s%f') DT = datevec(strcat(D,'-',T),'dd.m...

12 years ago | 0

Answered
How can I get out the row numbers in where there are numbers except for zeroes?
RowNumber = find(ColumnVector)

12 years ago | 0

| accepted

Answered
Fast creation of vector [0 0 1 1 2 2 3 3... n n]
n = 10 % max value k = 3 % number of repetitions V = floor((0:k*(n+1)-1)/k)

12 years ago | 2

Answered
How can i remove this logical operator error?
One of the terms is not convertible to a logical scalar. Most likely, one or both of these terms are arrays. What does siz...

12 years ago | 0

| accepted

Answered
How do you transform a vector of numbers into a cell of strings?
A = [1:5].' B = arrayfun(@(x) num2str(x),A,'un',0)

12 years ago | 2

| accepted

Answered
How can I get "least frequent" number from a vector?
Option 1: You can copy the code from mode.m and replace the function max by the function min on line 130 (in R2014a). Edit the h...

12 years ago | 3

| accepted

Answered
permutation without replacement matrix
% a smaller example k = 2 ; n = 4 ; v = perms(1:k) % all permutations of values 1:k v = [zeros(size(v,1),1) v...

12 years ago | 2

| accepted

Answered
How to remove rows with any string from matrix
Assuming that the rows are lines of a text file: T = textread('data.txt','%s','delimiter','\n') T2 = T(~cellfun(@(x)...

12 years ago | 0

| accepted

Answered
How to Find Column Duplicates
X = A{1} X = X(:,3) % just column 3 [a,i,j] = unique(X) % find all unique elements n = histc(j,1:numel(a)) % ...

12 years ago | 1

| accepted

Answered
Extract numbers between two underscores.
str = 'Color_84_2014-01-31-16-49-31-702.jpg' num = sscanf(str,'Color_%d') If your strings are stored in a cell array of...

12 years ago | 1

Answered
read data from variables with names matching patterns
X = load('StudentsMatfile.mat') ; LABELS = fieldnames(X) ; N = numel(LABELS) DATA = cell(N,1) for k=1:N DATA...

12 years ago | 1

Answered
How do I determine the number of headerlines in a text document?
Read the file as strings and parse the strings. The following might work (at least it works when I copied your example into a fi...

12 years ago | 3

Answered
Store columns in a matrix in different variables
Why do you want to do this? It is much easier to deal with a specific column using indexing A(:,13) then using variable names li...

12 years ago | 0

Answered
How to make a linear regression line?
The function <http://www.mathworks.nl/help/stats/lsline.html LSLINE> will add a linear regression line to a plot.

12 years ago | 0

Load more