Answered
I am not getting the correct keyword?
For writing and reading to files in Matlab you need a so called file identifier, or fid, that is generated using fopen and the n...

10 years ago | 0

| accepted

Answered
Shade the area between two graphs
<http://www.mathworks.com/matlabcentral/fileexchange/13188-shade-area-between-two-curves>

10 years ago | 0

| accepted

Answered
Read binary with ascii header
Use fgets to read the first ASCII lines and then use fread (with appropriate arguments) for the remaining binary stuff.

10 years ago | 0

Answered
Vector of dates going back one rolling year
A = datevec(now); m = A(2) - [0:11]; y = repmat(A(1), 1, 12); Find month that are in the previous years and set month...

10 years ago | 0

Answered
If statement in cell array; skip row if it equals certain value
Subtract = RigidBodies(1).Marker4(1,:); for c = 1 : numel(RigidBodies) nmarkers = fieldnames(RigidBodies(c))...

10 years ago | 0

Answered
Search data in cell array from disk?
<http://de.mathworks.com/help/matlab/import_export/load-parts-of-variables-from-mat-files.html>

10 years ago | 0

Answered
Finding the averages for a unique value.
X = input; A = X(:,1); MC = arrayfun(@(i) mean(X(A == i, 2:end)), unique(A), 'UniformOutput', false); M = reshape(cel...

10 years ago | 0

Answered
How can I generalize it ?
A{1} = conv([1 -r(1)],[1 -r(2)]); for i = 3:numel(r) A{i-1} = conv(A{i-2},[1 -r(i)]); end

10 years ago | 0

| accepted

Answered
column in matlab to excel?
Have a close look at your code. You set raw{r+1,cols+2}=s; before you determine the value of s in the following if s......

10 years ago | 0

Answered
how do i combine figures' y - values
How to extract data from a fig is described in <http://www.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from...

10 years ago | 0

Answered
Can someone help me understand how this loop works?
You can add fprintf('(i=%d, j=%d):', i, j) disp(A) pause after the if in the inner loop and see what happens: ...

10 years ago | 0

| accepted

Answered
video processing( find white pixel in binary image)
Sample data: X = rand(5)>0.8; Check if any pixel is 1 if any(X(:)) % do something end

10 years ago | 0

| accepted

Answered
select first standard answer equal or greater than obtained answer
I(find(I>=H, 1, 'first'))

10 years ago | 0

| accepted

Answered
I need help please
You did not tell us what you want to do, so it is somewhat speculative to propose what you should do. If you want to plot a line...

10 years ago | 0

Answered
Replacing NaN with variable data
This works is you have at least N values in up, where N is the number of NaNs in u. u=[0;0;0;0;NaN;NaN;NaN;NaN;NaN;NaN;NaN;N...

10 years ago | 1

| accepted

Answered
HOW TO PLOT AN ECONOMIC SERIES
X = xlsread('../../Downloads/mexico_data_1900_2005.xls'); plot(X(:,1), X(:,2:end))

10 years ago | 0

| accepted

Answered
How to count a number of edges counting from canny?
You can use bwlabel.

10 years ago | 1

| accepted

Answered
Help me understand this code
gx and gy mark edges in the image in x and y direction. g is an image of the edges. You have 5 distinct edges in g, the outer bo...

10 years ago | 0

Answered
how to calculate area integral using cumsum under a known matrix of peaks and it +-50ms surrounding
Your solution is wrong, because you use index(i) as the increment; you probably want ecg_from_database(index(i)-50:index(i...

10 years ago | 0

Answered
Compare values of array of matrix 5x5x106
If you want to compare every matrix with each other, you have 5565 pairs to compare: Npairs = nchoosek(1:106,2); N = size(...

10 years ago | 1

| accepted

Answered
determine location of numbers within a vector
ind = arrayfun(@(val) find(val == x), 20:22)

10 years ago | 0

Answered
Adding binary matrices generated in while loop
Just add the masks. And use a for loop instead of a while: mask = zeros(size(rr)); for i = 1:numel(radii1) maska = mas...

10 years ago | 1

Answered
How to fit two equations to one dataset
data(data < -10) = [];

10 years ago | 0

Answered
license plate recognition- need to compare with data stored in .mat file
Load the .mat file. Suppose it contains a cell string of all valid licences, use if any(strcmp(valid_licences, current_licen...

10 years ago | 1

| accepted

Answered
Files not being read correctly
The problem in your code is that you do not save anything for the composite file. Also the first save(newfilename,'PINC')...

10 years ago | 1

| accepted

Answered
Help! Z must be a matrix, not a scalar or vector?
You can use surf only to display a 2D surface, but not for volume data. For volume data, have a look at <http://de.mathworks.com...

10 years ago | 0

| accepted

Answered
How to re-produce an existing variable in the script without using it?
You can use dlmwrite the write A to a file, open the file in an editor and copy and paste the contents to your script and add th...

10 years ago | 1

Answered
how to find blocks of values within array where difference is less than X for a specific number of values without losing the last value?
The code computes the differences *between* positions such that the final position is dropped. Just add it, using y+1: allI...

10 years ago | 0

| accepted

Answered
how to find blocks of values within array where difference is less than X for a specific number of values without losing the last value?
The code computes the differences *between* positions such that the final position is dropped. Just add it, using y+1: allI...

10 years ago | 0

Answered
using the int i as output name
This is a possible framework of how to process 30 files: for i = 1:30 input_filename = sprintf('%d.wav', i) %...

10 years ago | 2

Load more