Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 0

Respondida
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 ...

alrededor de 12 años hace | 0

Respondida
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?

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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 ,'...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 1

| aceptada

Respondida
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...

alrededor de 12 años hace | 1

Respondida
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 ...

alrededor de 12 años hace | 0

Respondida
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 %...

alrededor de 12 años hace | 2

Respondida
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...

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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)

alrededor de 12 años hace | 2

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 2

| aceptada

Respondida
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...

alrededor de 12 años hace | 3

| aceptada

Respondida
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...

alrededor de 12 años hace | 2

| aceptada

Respondida
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)...

alrededor de 12 años hace | 0

| aceptada

Respondida
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)) % ...

alrededor de 12 años hace | 1

| aceptada

Respondida
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...

alrededor de 12 años hace | 1

Respondida
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...

alrededor de 12 años hace | 1

Respondida
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...

alrededor de 12 años hace | 3

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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.

alrededor de 12 años hace | 0

Cargar más