답변 있음
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...

11년 초과 전 | 0

답변 있음
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...

11년 초과 전 | 0

| 수락됨

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

11년 초과 전 | 0

답변 있음
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 ...

11년 초과 전 | 0

답변 있음
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?

11년 초과 전 | 0

답변 있음
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...

11년 초과 전 | 0

답변 있음
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...

11년 초과 전 | 0

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

11년 초과 전 | 0

답변 있음
find X of corresponding local minima
Finding minima of a signal X is the same as finding the maxima of the signal *-X*

11년 초과 전 | 0

| 수락됨

답변 있음
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...

11년 초과 전 | 0

| 수락됨

답변 있음
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 ,'...

11년 초과 전 | 0

| 수락됨

답변 있음
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...

11년 초과 전 | 0

답변 있음
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...

11년 초과 전 | 1

| 수락됨

답변 있음
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...

11년 초과 전 | 1

답변 있음
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 ...

11년 초과 전 | 0

답변 있음
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 %...

11년 초과 전 | 2

답변 있음
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...

11년 초과 전 | 0

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

11년 초과 전 | 0

| 수락됨

답변 있음
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)

11년 초과 전 | 2

답변 있음
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...

11년 초과 전 | 0

| 수락됨

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

11년 초과 전 | 2

| 수락됨

답변 있음
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...

11년 초과 전 | 3

| 수락됨

답변 있음
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...

11년 초과 전 | 2

| 수락됨

답변 있음
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)...

11년 초과 전 | 0

| 수락됨

답변 있음
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)) % ...

11년 초과 전 | 1

| 수락됨

답변 있음
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년 전 | 1

답변 있음
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년 전 | 1

답변 있음
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년 전 | 3

답변 있음
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년 전 | 0

답변 있음
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년 전 | 0

더 보기