Answered
Raw EEG in .pdf, processing first step
You can read edf using function from file exchange <http://www.mathworks.com/matlabcentral/fileexchange/31900-edfread> or ...

11 years ago | 0

Answered
want ideas for contour, z is not a function for x,y
Yes. Just use contour(X,Y,Z)

11 years ago | 0

Answered
I've got a matrix with 4 columns and I want to insert a fifth one and I want it to have either -1,1 or 0 depending on the results of the subtraction of the values from my colums 3 and 2.
x(:,end+1) = double(-(x(:,4) < 0)) + double(x(:,4) > 0); Because the - converts from logical to double, you do not need the...

11 years ago | 0

| accepted

Answered
ignoring the negative values....
cumsum(a(a > 0))

11 years ago | 1

| accepted

Answered
Problem with "change directory" in a for loop
Using cd just to read data is error prone. Because you have to ensure that after cd to change back to your original dir, otherwi...

11 years ago | 0

| accepted

Answered
how to plot 3d pyramid ?
P = [pt1; pt2; pt3; pt4; pt5] ind = [1 2 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r') hold on ind = [2 3 5]; patch...

11 years ago | 1

| accepted

Answered
The matlab code doesn't work?
What is the purpose of the for loop? It computes for 11 values of k (from -5 to 5) different x. But nothing is done with the x a...

11 years ago | 0

Answered
ECG, difference between original data and imported data of original data into Matlab
The default format do display numbers in Matlab is short, i.e., "Scaled fixed point format with 5 digits.". If you want to see m...

11 years ago | 0

| accepted

Answered
Reading numeric values from complex text files
You can process individual lines using s = fgets(fid); data(i,:) = sscanf(s, '%f (%fdB, %f)');

11 years ago | 1

Answered
How can I find the starting index number when my numbers are changing through a column vector?
Your question is somewhat unclear to me. What do you mean by starting index? If you have a vector in Matlab, the starting index ...

11 years ago | 0

Answered
I am getting some error in matrix multiplication. Kindly help me in this regard.
If y is of size 240x1, than the result of (transpose(A)*A)\transpose(A)*y will be of the same size. You cannot assign a vector t...

11 years ago | 0

Answered
how to initialise a struct array with pairs?
Initialise data(1).name = {'TJ', 'Tom Jones'}; data(2).name = {'JS', 'John Smith'}; Get entries data(1).n...

11 years ago | 1

Answered
How can I solve the problem 'Subscripted assignment dimension mismatch' in my looping progress?
The error seems to be due to the first two arguemnts. Try [a,b,itr(i),irec(i),dt,offset,sdepth,selev,relev(i),... ...

11 years ago | 0

Answered
Why does circle transform into a elipse when i plot a line and a circle ?
axis equal

11 years ago | 0

| accepted

Answered
How to deal with white spaces?
if strcmp(action1, 'OPEN DOOR') display('stuff goes here') end

11 years ago | 0

| accepted

Answered
How to do the following in one line?
data = data(data>xmin & data<xmax);

11 years ago | 1

| accepted

Answered
i am trying to save .mat file but its not working.
You evaluate the string save D:\F2\A240_50_1 Best_mat; That is, you try to save the variable 'Best_mat' to the file A240...

11 years ago | 0

Answered
write an m-file using while loop which calculates the sum of elements within the following vector x=[5 2 -9 10 -1 9 -1] until a number greater than 8 is met? please help i have tried and i am confused on how to do this.
x=[5 2 -9 10 -1 9 -1]; partialsum = 0; i = 1; while partialsum <= 8 partialsum = partialsum + x(i); i = i ...

11 years ago | 0

| accepted

Answered
How to expand a summation with different indexes
sum(diff(f(1:4)).*n(1:3).*arrayfun(@(x) sum(m(x:end)), 3:5))

11 years ago | 1

Answered
Find groups of 1's in array
Nsplit = 5; % number of consecutive zeros that split a group Z = find(diff(x) == 1) - find(diff(x) == -1); Ngroups = sum(Z ...

11 years ago | 0

| accepted

Answered
Arrange Matrix - Each Column Values to a new row
You can transpose cells in Matlab: destData = destData';

11 years ago | 0

Answered
How to multiply with a factor with time series data
CN = [68, 78, 90, 90, 78]; S = 1000./CN - 10;

11 years ago | 0

| accepted

Answered
Nested if conditions to compute flow
Does this work for you? idx = Rainfall > 0.2; Runoff(idx) = 1000/CN(idx) - 10; Runoff(~idx) = (Rainfall(~idx) - 0.2 * (1...

11 years ago | 0

Answered
Unique Permutation: with logical Elements OR with vectors which should at the end stand as one dimension (after each other) in a 2-dim-Matrix
This generates your example; you may generate the other matrices accordingly. N = 3; m = logical(fliplr(eye(N))) m1 = re...

11 years ago | 1

Answered
When a function is invoked, how do you supress the "ans = ... " output? I have a semicolon on every single line in the function and yet I still get the "ans" output!
If you define a function to return something, and call it from the command line like >> myfun(23) it will return an an...

11 years ago | 1

| accepted

Answered
How I solve this equation (delta function)
In this formula m is not a 1x256 matrix, but a function that you can define as, e.g., gamma = 2.3; N = 256; m = @(j) N*...

11 years ago | 0

| accepted

Answered
Why makehgtform creates 4x4 matrices? Why not 3x3?
Rotation and scaling transformation matrices only require three columns. But, in order to do translation, the matrices need to h...

11 years ago | 1

Answered
If else condition for the rainfall
You didn't mention what went wrong; the following code should work for you: Rainfall = rand(1,10); % fake some data CN = 2...

11 years ago | 0

Answered
find '1' in an array
It is not entirely clear what you want to achieve; if you just want to get rid of the 0's, use x = [1 1 1 0 1 0 1 1 1 0 1 0 ...

11 years ago | 0

Answered
loop/cycle for producing the following sequence of numbers A={1, 4, 5, 8, 9, ....} and/or B={2, 3, 6, 7, 10,....}
idx = repmat([1 1 0 0], 1, 3) idx = idx(2:end-1); X=[0 0 0 0 0], Y =[-1 -1 -1 -1 -1] Z(idx == 0) = X; Z(idx == 1) = ...

11 years ago | 0

Load more